# https://qiita.com/asksaito/items/76b71602dd956b79dbf7
in_data_number = int(input())
in_data = [0]*in_data_number
mod_zero_cnt = 0
prime_number = 0
for i in range(in_data_number):
    mod_zero_cnt = 0
    in_data[i] = int(input())
    
    for j in range(1,int(in_data[i]/2)+1):
        if in_data[i] != 2 and in_data[i] % 2 == 0:
            break
        mod_result = in_data[i] % j
       # print("in_data={}".format(in_data))
        #print("division={}".format(j))
        if mod_result == 0:
            mod_zero_cnt += 1
            #print("mode_zero_cnt: {}".format(mod_zero_cnt))
    if mod_zero_cnt == 1:
        prime_number += 1
print(prime_number)
