#ALDS1_1-C Prime Numbers
def prime(n):
    s=2
    while(s*s <= n):
        if(n%s==0):
            return False
        s+=2
    return True

n=int(input())
num=0
for i in range(n):
    x = input()
    if prime(int(x)):
        num+=1
print(num)