sum = []
ava = []
while line = gets
line = line.split(",").map{|i| i.to_i}
sum << line[0]*line[1]
ava << line[1]
end
sum = sum.inject{|sum,n| sum+n}
ava_sum = 0
count = 0
for i in ava do
ava_sum += i
count += 1
end
ava_sum = (ava_sum/count.to_f).round

puts sum
puts ava_sum
