def IsPrime(n)
    if n<2 then return false
    elsif n==2 then return true
    elsif n%2==0 then return false
    else
      i=3
      loop do
         if i>n/i then break end
         if(n%i==0)then return false end
         i+=2
      end
    end
    return true
end

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