import Control.Applicative ((<$>)) import Data.Char (isDigit, digitToInt) import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as B main :: IO () main = do solve <$> B.getLine >>= print solve :: ByteString -> Int solve = B.foldl' f 0 where f x c | isDigit c = x + digitToInt c | otherwise = x