import math

def isprime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n != i and n % i == 0:
            return False
    return True

ans = 0
N = int(raw_input())
for _ in range(N):
    if isprime(int(raw_input())):
        ans += 1
print ans

