import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List
import Data.List.Split (splitOn)

main :: IO ()
main = do
  xs <- inpi $ map toInt . splitOn ","
  mapM_ print $ solve xs

solve :: [[Int]] -> [Int]
solve xs = [sm, av]
  where
    sm = (sum . map (\x -> (x !! 0) * (x !! 1))) xs
    av = round $ (fromIntegral . sum . map (!!1)) xs / (fromIntegral $ length xs)

toInt :: String -> Int
toInt s = read s

inpi :: (String -> a) -> IO [a]
inpi f = map f . lines <$> getContents