import Control.Monad

cntDigit :: String -> Int
cntDigit [] = 0
cntDigit (x:xs) | x `elem` ['1'..'9'] = 1 + cntDigit xs
                | otherwise           = cntDigit xs

solv :: String -> String
solv s = show . sum . map cntDigit . words $ s

main = getContents >>= mapM_ (putStrLn . solv) . lines