#encoding:utf-8 No.0045 2014.10.5
ary = []
while gets
  data = $_.chomp.split(/,/).map{|item| item = item.to_i}
  ary.push data
end

sum = 0
average = 0.0

ary.length.times do |i|
  sum += ary[i][0]*ary[i][1]
  average += ary[i][1].to_f
end

average /= ary.length.to_f

puts sum
printf("%.0f\n",average)