def isprime(x):
    i = 2
    while i * i <= x:
        if x % i == 0: return False
        i += 1
    return True

n = int(input())
xs = []
for i in range(n):
    x = int(input())
    xs.append(x)

print(sum(1 for x in xs if isprime(x)))
