import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

N = input()
l = [input() for i in range(N)]
a = 0
for i in range(0,len(l)):
    if ( is_prime(l[i]) == True
         a += 1
print(a)

