def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
cnt=0

for i in range(int(input())):
    if is_prime(int(input()))==1:cnt+=1

print(cnt)
