n = int(input())
prime = 0
for i in range(n):
    m = int(input())
    cout = 0
    for j in range(m):
        if m % (j+1) == 0:
            cout += 1
    if cout == 2:
         prime += 1
print(prime)