import Data.List

split :: String -> [String]
split s = impl $ break (== ',') s
    where
        impl (x , y) = [x , tail y]

go :: [[Int]] -> [Int]
go = foldl' f [0,0]
    where
        f [x1,y1] [x2,y2] = [x1 + x2 , y1 + y2]

main :: IO ()
main  = getContents
    >>= return . map (map read) . map split . lines
    >>= return . go
    >>= print