import math
def S(N) :
    for i in range(2, int(math.sqrt(N))+1) :
        if N % i == 0 :
            return 'F'
    return 'T'
    

n = int(input())
ans = 0
for j in range(n) :
    a = int(input())
    if S(a) == 'T' :
        ans += 1

print(ans)
