import math

n = int(input())
count = 0

def w(a) :
    for i in range(2, int(math.sqrt(a))+1):
        if a % i == 0:
            return False
    return True

for i in range(n):
    a = int(input())
    if w(a):
        count += 1
        
print(count)
