round' :: (RealFrac a, Integral b) => a -> b
round' x
  | f <= -0.5 = n - 1
  | f >= 0.5  = n + 1
  | otherwise = n
  where (n, f) = properFraction x

solve :: [(Int, Int)] -> (Int, Int)
solve xs = let (tp, tn) = foldl f (0, 0) xs
               f (tp, tn) (p, n) = (tp + p * n, tn + n)
            in (tp, round' (fromIntegral tn / fromIntegral (length xs)))

main :: IO ()
main = getContents >>= printResult . solve . input
  where input = map (tup . words) . lines . map c2s
        c2s c = if c == ',' then ' ' else c
        tup (a:b:_) = (read a, read b)
        printResult (a, b) = print a >> print b