module Main where import Text.Printf main :: IO () main = interact (show . count . bshow . read) bshow :: Int -> String bshow = printf "%b" count :: String -> Int count = foldl f 0 where f 0 '0' = 0 f 0 '1' = 1 f n '0' = succ n f n '1' = succ (succ n)