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