import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.Maybe (fromJust)
import Debug.Trace

solve :: Int -> Int -> Int
solve x time
    | (x - time) <= 0 = time
    | otherwise = solve (x - time) (time + 1)

main :: IO ()
main = do
    x <- (fst . fromJust . BS.readInt) <$> BS.getLine
    print $ solve x 1