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

result = 0
for i in range(int(input())):
    result += isprime(int(input()))
print(result)