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

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

print(len([i for i in a if isPrime(i)]))



