import Data.List

main = do
  x <- readLn
  print $ head $ solve x (1, x)

solve x (a, b) = unfoldr f (a, b)
  where
    f (a, b)
      | a == b = Nothing
      | a + 1 == b =Nothing
      | c * c < x = Just (c, (c, b))
      | otherwise = Just (a, (a, c))
    c = (a + b) `div` 2