average1 = []
average2 = []
while tmp = gets
  p tmp = gets.chomp.split(",").map(&:to_i)
  # puts tmp.split(",").map(&:to_i)
  average1 << tmp[0] * tmp[1]
  average2 << tmp[1]
end


puts average1.inject(:+)
puts average2.inject(:+).to_i/average2.size.round.to_i

