countOne :: String -> Int -> Int
countOne str n | null str        = n
               | head str == '1' = countOne (tail str) (n+1)
               | otherwise       = countOne (tail str) n

main = do
  s <- getLine
  print $ countOne s 0
