from typing import List
from typing import Counter


def count_number_of_lanternfish(fish_array: List[int], number_of_days: int) -> int:
    """Counts the number of lanternfish after a given number of days,
    according given breeding rules.

    Args:
        fish_array: An int array, each representing the internal counter of a lanternfish.
        number_of_days: For how long to run the simulatiom

    Returns:
        The number of lanternfish after the given number of days.

    >>> count_number_of_lanternfish([3,4,3,1,2], 18)
    26
    >>> count_number_of_lanternfish([3,4,3,1,2], 80)
    5934
    """
    c = Counter(fish_array)
    for i in range(number_of_days):
        next_day: Counter[int] = Counter()
        for key in c:
            if key == 0:
                next_day[8] = c[key]
            else:
                next_day[key - 1] = c[key]
            next_day[6] = c[0] + c[7]
        c = next_day
    return sum(c.values())