#encoding:utf-8 No.0045 2014.10.5
sum = 0
average = 0.0
count = 0.0

while gets
  count += 1.0
  data = $_.chomp.split(/,/).map{|item| item = item.to_i}
  sum += data[0]*data[1]
  average += data[1].to_f
end

puts sum
puts (average/count).round