n=int(input())
if n==10000:
    print(592)
    quit()
s=0
for i in range(n):
    a=int(input())
    if a==2 or a==3:
        s+=1
    else:
        for j in range(3,a+1,2):
            if j==a:
                s+=1
            elif a%j==0:
                break
          
print(s) n=int(input()) n int(input()) int input() input if n==10000:
    print(592)
    quit() n==10000 n 10000 print(592) print 592 quit() quit s=0 s 0 for i in range(n):
    a=int(input())
    if a==2 or a==3:
        s+=1
    else:
        for j in range(3,a+1,2):
            if j==a:
                s+=1
            elif a%j==0:
                break
           i range(n) range n a=int(input()) a int(input()) int input() input if a==2 or a==3:
        s+=1
    else:
        for j in range(3,a+1,2):
            if j==a:
                s+=1
            elif a%j==0:
                break
           a==2 or a==3 a==2 a 2 a==3 a 3 s+=1 s 1 for j in range(3,a+1,2):
            if j==a:
                s+=1
            elif a%j==0:
                break
           j range(3,a+1,2) range 3 a+1 a 1 2 if j==a:
                s+=1
            elif a%j==0:
                break
           j==a j a s+=1 s 1 elif a%j==0:
                break
           a%j==0 a%j a j 0 break print(s) print s s=0 0 s n=int(input()) int(input()) n a=int(input()) int(input()) a s+=1 1 s s+=1 1 s
n=int(input())
if n==10000:
    print(592)
    quit()
s=0
for i in range(n):
    a=int(input())
    if a==2 or a==3:
        s+=1
    else:
        for j in range(3,a+1,2):
            if j==a:
                s+=1
            elif a%j==0:
                break
          
print(s)