main :: IO()
main = do
    strLs <- getLine
    print $ oneCount strLs


oneCount :: [Char] -> Int
oneCount [] = 0
oneCount ls = if (head ls == '1') then 1 + (oneCount $ tail ls) else oneCount $ tail ls