n = int(input())

import math

cnt = 0

for _ in range(n):
    x = int(input())
    
    flag = 1
    
    for i in range(2, int(math.sqrt(x))+1):
        if x % i == 0:
            flag = 0
            break
    cnt += flag
    
print(cnt)
