include Math

ans = 0
num,*ary = $<.map &:to_i
maxnum = ary.max

ary.each do|i|

  if !( i % 2 == 0 || i % 10 ==5 )

  for j in 3..sqrt(i).floor

   if i % j == 0

    ans -= 1
    break

   end

   ans += 1

  end
 end
end

puts ans


