from typing import Dict
from typing import Iterable


def counter(dic: Dict, ns: Iterable) -> Dict:
    """Counts the number of times each element in ns appears and adds it to dic

    Args:
        dic (dict): The dictionary to add the counts to
        ns (iterable): The elements to count

    Returns:
        dict: The dictionary with the counts added
    """
    for n in ns:
        dic[n] = dic.get(n, 0) + 1

    return dic