import math
x = 0
a = int(input())
for _ in range(a):
    n = int(input())
    if n == 1:
        x = x + 1
        continue
    for i in range(2,int(math.sqrt(n))+1):
        if n % i == 0:
            x = x + 1
            break
print(a-x)
