import math
n = int(input())
s = 0
for i in range(n):
    j = int(input())
    flg = False
    for p in range(2, int(math.sqrt(j)) + 1):
        if j % p == 0:
            flg = True
            break
    if flg == False:s += 1
print(s)
