import math
def prime(num):
    judge = True
    for i in range(1, int(math.sqrt(num)+1)):
        if num % i == 0:
            judge = False
    return judge
    
n = int(input())
cnt = 0
for i in range(n):
    num = int(input())
    
    if prime(num) == True:
        cnt += 1
print(cnt)
