import math
n=int(input())
def sosu(a):
    for i in range(2,int(math.sqrt(a))+1):
        if a%i==0:
            return False
    return True
m=0
for i in range(n):
    a=int(input())
    if sosu(a):
        m+=1
print(m)
