# O(n) algorithm
def isPrime_naive(x):
    if x <= 1:
        return False
    for i in xrange(2, x):
        if x % i == 0:
            return False
    return True

# Fast algorithm
def isPrime(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0:
        return False
    i = 3
    while i*i <= x:
        if x % i == 0:
            return False
        i += 2
    return True

cnt = 0
N = int(raw_input())
for _ in range(N):
    x = int(raw_input())
    if isPrime(x):
       cnt += 1
print cnt
