def prime(n):
    if (n==2):
        return True
    elif(n == 1):
        return False
    else:
        pr = [2]
        for i in range(3,n):
            c = 0
            for p in pr:
                if (i % p != 0):
                    c = c + 1
            if (c == len(pr)):
                pr.append(i)
        cc = 0        
        for p in pr:
            if(n%p != 0):
                cc = cc + 1
    
    if(cc == len(pr)):
        return True
    else:
        return False
        
    
N = int(input())

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