import math

def hurui(a):
    ret = [True for i in range(a+1)]
    for i in range(2, int(math.sqrt(a))+2):
        for j in range(i*2, a+1, i):
            ret[j] = False

    return ret

n = int(input())
l = hurui(100000000)
ans = 0
for i in range(n):
    a = int(input())
    if l[a]:
        ans += 1

print(ans)