import math
n = int(input())
cnt_prime = n

for i in range(n):
    m = int(input())
    for k in range(2, int(math.sqrt(m))+1):
        if m % k == 0 and m != k:
            cnt_prime -= 1
            break
        
print(str(cnt_prime))
