n = input()
count = 0
for i in range(n):
    x = input()
    if x == 2: count += 1
    elif x % 2 != 0:
        for j in range(3,int(x*0.5+1),2):
            if x % j == 0: break
        else: count += 1
print count