import math

m=int(input())
cnt=0

for i in range(m):
    n=int(input())
    if n==2: 
        cnt+=1
        continue
    if n%2==0: 
        continue
    
    sq=int(math.sqrt(n))+1
    for j in range(3,sq,2):
        if n%j==0:
            continue
    cnt+=1
