gcm :: Int -> Int -> Int
gcm a b | a < b     = gcm b a
        | b == 0    = a
        | otherwise = gcm b (a`mod`b)

prime :: Int -> Int -> Bool
prime 1 _ = True
prime i n | gcm i n == i = False
          | otherwise    = prime (i-1) n

primeNum :: Int -> Int
primeNum 2 = 1
primeNum n | prime (n-1) n = 1 + primeNum (n-1)
           | otherwise = primeNum (n-1)

main = interact (unlines . map (show . primeNum . read) . lines)