def judge(n):
    if n<2:
        return False
    if n==2:
        return True
    if n%2==0:
        return False
    i=3
    while i<n:
        if n%i==0:
            return False
        i+=1
    return True

N=int(input())
count=0
for i in range(N):
    if(judge(int(input()))==True):
        count+=1

print(count)