import Control.Applicative import Control.Monad main = do ss <- string2int <$> getLine putStrLn $ show (ss * 2 - (calc ss)) calc :: Integer -> Integer calc 0 = 0 calc n = n + calc (n `div` 2) string2int str = read str :: Integer