n = int(input())
count = 0
for i in range(n):
    flag = 0
    N = float(input())
    if N == 1:
        flag = 1
    
    if N > 2 and N%2 == 0:
        flag = 1
    
    for j in range(2, int(1+N**0.5)):
        if flag == 1:
            break
        if float(N%(j)) == 0:
            flag = 1
    
    if flag == 0:
        count += 1

print(count)
