x = int(input())

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

