def isprime_euclid2(N):
    if N<1:
        print 'N>2'
    elif N==2:
        return True
        
    
    def euclid(m,n):
        while m%n>0:
            r=m%n
            m,n=n,r
        else:
            return n
        
    euclid_list=[]
    for k in range(1,int(round(math.sqrt(N)))+1):
        euclid_list.append(euclid(N,k))
    temp=set(euclid_list)
    if len(temp)==1:
        return True
    else:
        return False  
           
import math
while True:
    n = int(raw_input())
    total = 0
    for k in range(n):
        if isprime_euclid2(int(raw_input())):
            total +=1
    print total
        