# https://qiita.com/fantm21/items/5e270dce9f4f1d963c1e
def get_sieve_of_eratosthenes(n):
    import math
    prime = []
    limit = math.sqrt(n)
    data = [i+1 for i in range(1,n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

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()
