import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  solve <$> getl read >>= print

solve :: Int -> Int
solve x = f [a .. b]
  where
    a = ceiling (sqrt (2 * fromIntegral x) - 1)
    b = floor (sqrt (2 * fromIntegral x) + 1)
    f (h:ts)
      | h * (h + 1) `div` 2 >= x = h
      | otherwise = f ts

getl :: (String -> a) -> IO a
getl f = f <$> getLine
