def judge(int):
    if int == 2:return 1
    elif int <= 1 :return 0
    for i in range(2,int - 1):
        if int%i == 0: return 0
    return 1



n = input()
count = 0
for i in range(n):
    if judge(input()) == 1:
        count+=1
print count