N = int(input())
a = []

for i in range(N):
    a.append(int(input()))


count = 0
Sosu = True

for i in range(N):
    for j in range(2,i):
        if i % j == 0:
            Sosu = False
            break
        else :
            pass
    if Sosu :
        count+=1
    else:
        pass

print(count)



