howmany = []
howmuch = []
x = gets
until x.nil?
 y = x.split(",")
 howmany << (y[0].to_i * y[1].to_i)
 howmuch << y[1].to_f
 x = gets
end

averegemuch = howmuch.sum / howmuch.length
totalmoney = averegemuch.round
totalsum = howmany.sum
puts totalsum
puts totalmoney
