def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError("n is int-type.")
    if n < 2:
        raise ValuseError("n is more than 2")
    data = [i for i in range(2, n+1)]
    for d in data:
        data = [x for x in data if(x==d or x % d !=0)]
    return data

def main():
    count = 0
    in_data_number = int(input())
    in_data = [0]*in_data_number
    mod_zero_cnt = 0
    prime_number = 0
    for i in range(in_data_number):
        mod_zero_cnt = 0
        in_data[i] = int(input())
    in_data_max = max(in_data)
    prime_number = get_sieve_of_eratosthenes(in_data_max)
    for i in range(in_data_number):
        if in_data[i] in prime_number:
            count +=1;
    print(count)
if __name__ == '__main__':
    main()
