import math
N = int(input())
count = 0
for _ in range(N):
    x = int(input())
    for i in range(2,int(math.sqrt(x)+1)):
        if x % i == 0:
            break
    else:
        count += 1
print(count)
