N = int(input())
a = [int(input()) for x in range(N)]

cnt = 0
for i in range(N) :
    cnt += 1
    if a[i] == 2 :
        continue
    else :
        for j in range(2, a[i]) :
            if a[i] % j == 0:
                cnt -= 1
                break
            
print(cnt)
