import qualified Data.Set as Set

main :: IO ()
main = do
  n <- readLn :: IO Integer
  let cs = scanl candidate (Set.fromList [0]) [1..n]
  print $ length $ takeWhile (\xs -> not $ Set.member n xs) cs


candidate cs i =
  Set.foldl f cs cs
  where
    f xs x =
      Set.union xs $ Set.fromList [x-i, x, x+i]