import Data.List

sieve :: [Int] -> [Int]
sieve ks = 2 : [2 * y + 1 | y <- baselist]
    where baselist = ks \\ [x | x <- ks, i <- [1 .. x - 1], j <- [i .. x - 1], i + j + 2 * i * j == x]

numOfPrimes :: Int -> Int
numOfPrimes n = length $ takeWhile (<= n) $ sieve [1 .. n]

main :: IO ()
main = putStr . unlines . map show . map numOfPrimes . map read . lines =<< getContents