def main
  sum = 0
  sumnum = 0
  count = 0
  while arg = gets
    arg = arg.split(",").map(&:to_i)
    sum += arg[0] * arg[1]
    sumnum += arg[1]
    count += 1
  end
  puts sum, (sumnum.to_f / count).round
end
main