N = int(input())
a = []

for i in range(N):
    a.append(int(input()))


count = 0
Sosu = True

for i in range(0,N):
    Sosu = True
    for j in range(2,a[i]):
        if a[i] % j == 0:
            Sosu = False
            break
        else :
            pass
    if Sosu :
        count+=1
    else:
        pass


print(count)





