include Math

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

ary.each do|i|

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

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

   if i % j == 0

    ans -= 1
    break

   end
  end
  
  ans += 1

 end
end

puts ans

