import Data.Bits main = do n <- return . (read::String->Integer) =<< getLine print $ (popCount n) `mod` 1004535809