def count(value, node):
    """
    Count number of list elements that match a value
    :param value: value to search for
    :param node: value of head node, start of list
    :return: int: number of elements that match the value
    """

    if node is not None:
        if value == node.value:  # basically same as length but only add if they match a value
            return 1 + count(value, node.next_node)
        return count(value, node.next_node)

    return 0