sum_price = 0
sum_number = 0
count = 0
while gets do
  price, num = $_.split(',').map(&:to_i)
  sum_price += price*num
  sum_number += num
  count += 1
end
puts sum_price, (sum_number.to_f/count.to_f).round