require 'prime'

primes = []
Prime.each(10000){|i|
primes.push(i)
}

n = gets.to_i
nums =[]
n.times{
nums.push(get.to.i)
}
cnt = n
nums.each{|val|
primes.each{|i|
break if val == i

if val%i == 0
cnt -=1
break
end
}
}
puts(cnt)