price_sum = amount_sum = count = 0
while gets
	price, amount = $_.chomp.split(',').map{|x| x.to_f}
	price_sum += (price * amount)
	amount_sum += amount
	count += 1
end
puts price_sum.to_i
puts (amount_sum / count).round