def prime_number(num):
    if num == 2 :
        return 1
    elif (num%2)==0:
        return 0
    elif num > 2:
        for i in range(3,num-1,2):
            if (num % i) == 0:
                return 0
        return 1

N =int(input())
count = 0
for i in range(0,N):
    num = int(input())
    count += int(prime_number(num))
print(count)
