is_prime = ->(n) {
  if n == 1 then
    return false
  elsif n == 2 then
    return true
  else
    lim = Math.sqrt(n).to_i + 1
    (2..lim).each do |i|
      if n % i == 0
        return false
      end
    end
    return true
  end
}

res = 0
while line = gets
  n = line.chomp.to_i
  if is_prime.call(n) then
    res += 1
  end
end
puts res