#?´???°????????°????±???????????????°??????

#??°?????¢??°???include
include Math

#??\??????????????????????????°?????\????????????
n = gets.to_i

#?´???°??????????????????????????????????????\????????????
count = 0
for i in 0..n-1
    number = gets.to_i
    #?´???°??????????????¨??????????????°
    flag = 0
    for j in 2..sqrt(number)
        #??\??????????????°??????2??????number?????????????????§??§?????????????????£??????????´???°??§?????????
        if number % j == 0 then
            flag = 1
            break
        end
    end
    # j = 2
    # while j != sqrt(number) + 1 || flag != 1
    #     if number % j == 0
    #         flag = 1
    #     end
    #     j = j + 1
    # end
    if flag == 0 && number != 1 then
        count = count + 1
    end
end

#?´???°????????°?????¨????????????
print count, "\n"