def count_elements(reference, to_count):
    """ Count how many elements of a list are in the reference list.

    :param reference: (list)
    :param to_count: (list)
    :returns: (int)

    """
    n = 0
    for x in to_count:
        if x in reference:
            n += 1
    return n