#!/usr/bin/ruby                                                                                                                                   
# -*- coding: utf-8 -*-                                                                                                                           

sales = 0
total = 0
count = 0.0
while s = gets
  cost, num = s.chomp.split(',').map do |s|
    s.to_i
  end
  sales += cost * num
  total += num
  count += 1
end
puts sales
puts (total / count).round