# coding:utf-8
array = []
cnt = 0
n = input()
for i in range(n):
    array.append(input())
for value in array:
    for value2 in range(2,value):
        if value % value2 == 0:
            break
    else:
        cnt += 1
print cnt