x = int(input())

count = 0
for i in range(0, x):
    a =  int(input())
    if a == 2 or a == 3:
        count += 0
    elif a == 4:
        count += 1
    c =int(a / 2)
    for j in range ( 2,  c ):
        if a % j == 0:
             count += 1
             break;
        
print(x-count)
        

