import Data.Bits main = readLn >>= print . popCount . f where f :: Integer -> Integer f x = x * 2 - 1