import math

p = 0
n = int(input())

for i in range(n):
    a = int(input())
    
    if a == 2:
        p += 1
    elif a%2 == 0:
        pass
    else:
        d = int(math.sqrt(a))
        for i in range(3,d):
            if a%i == 0:
                break
        p += 1

print(p)