total_num = 0
total_sum = 0
count = 0

while line = $stdin.gets
	data = line.split(/,/).map{|n| n.to_i }
	price = data[ 0 ]
	num   = data[ 1 ]

	total_num += num
	total_sum += (price * num)
	count += 1
end
printf("%d\n%d\n", total_sum, (total_num.to_f / count.to_f).round) if count > 0
