n = gets.chomp.to_i
data = Array.new(0)
n.times { |i|
	data[i] = gets.chomp.to_i
}
data.sort!
prime = [2]

for i in 3..data[n-1]
    j = 0
    flg = 1
    while j < prime.length
        if i % prime[j] == 0
            flg = 0
            break
        end
        j+=1
    end
    if flg == 1
        prime[j] = i
    end
end

cnt=0
i = 0
j = 0
while i<data.length && j<prime.length
    if data[i] == prime[j]
        cnt+=1
        i+=1
        j+=1
    elsif data[i] < prime[j]
        i+=1
    else
        j+=1
    end
end
puts cnt