def gen(m)
    ar=Array.new
    for x in 2..m do
       flg=0
       ar.each do |e|
         if x%e==0 then
            flg=1
            break
         end
       end
       if flg==0 then ar.push(x) end
    end
    return ar
end

n=gets.to_i
ar=Array.new(n)
for i in 0..n-1 do
    ar[i]=gets.to_i
end
er=gen(ar.max)
cnt=0
ar.each do |x|
   if er.include?(x) then cnt+=1 end
end
p cnt