def prime(x):
    if x == 2: return True
    elif x % 2 == 0: return False
    else:
        for j in xrange(int(x*0.5+1),2,-2):
            if x % j == 0: return False
        else: return True

n = input()
count = 0
for i in xrange(n):
    if prime(input()): count += 1
print count