import math as ma

num = int(input())
ans = 0
for i in range(num):
    x = int(input())
    ok = 1
    for j in range(2,int(ma.sqrt(x)+1)):
        if (x % j == 0):
            ok = 0
            break
    ans += ok

print(ans)

