import Control.Monad
import Control.Applicative
import Data.Functor
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Foldable (foldMap)
import Data.List.Split
import Data.Char
import Data.Ratio
import Data.Ord
import Data.Array.IO
 
readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete


divRoundHalfUp n d = if frac*2>=d then int+1 else int
  where
    (int, frac) = divMod n d

f d = [s, a]
  where
    s = sum . map product $ d
    cts = map (!!1) $ d
    a = divRoundHalfUp (sum cts) $ length cts

main = map (map read . wordsBy (==',')) . lines <$> getContents >>= mapM_ print . f