#encoding:utf-8 No.0045 2014.10.5
count = 0
sum = 0
average = 0.0
while gets
  count += 1
  data = $_.chomp.split(/,/).map{|item| item = item.to_i}

  sum += data[0]
  average += data[1]
end

average /= count.to_f

puts sum
printf("%i\n",average)