N = int(input())
ans = 0

def prime(x):
    if x<2:
        return 0
    elif x %2 == 0:
        if x ==2:
            return 1
        else :
            return 0
    else:
        i = 3
        while i**2<= x:
            if x % i== 0:
                return 0
        return 1

for i in range(N):
    x = int(input())
    if prime(x) ==1:
        ans +=1
print(ans)