#! -*- coding:utf-8 -*-
# ?´???°??????
# ???????????§????????°??????????????????????¢????????´???°?????????????????????????????§????????????
def is_prime(num):
    if num==2 or num==3:
        return True
    for x in xrange(2,int(num**0.5)+1):
        if num%x ==0:
            return False
    return True

count = 0
for i in xrange(input()):
    input_prime_candidate = input()
    if is_prime(input_prime_candidate):
        count+=1
print count