main = getContents >>= mapM_ (putStrLn . fout . prime_number . fin) . lines
fin = read
fout = show 
prime_number n = length (filter isPrime [2..n])
isPrime n = all (\x -> mod n x /= 0) [2..(round . sqrt . fromIntegral) n]