import math
N=int(input())
cnt=0
for i in range(N):
    
    n=int(input())
    if n==2 or n==3:
        cnt=cnt+1
    elif n!=1:
        b=1
        for j in range(2,int(math.sqrt(n))+1):
            
            a=n%j
            if a==0:
                b=0
        if b==1:
            cnt=cnt+1
print(cnt)

