#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;

int main() {
	int price, num,total_price=0,total_num=0,avarage,i=0;
	while (scanf("%d,%d", &price, &num)!=EOF) {
		total_price = total_price + price*num;
		total_num = total_num + num;
		i++;
	}
	avarage = round(total_num / i);
	cout << total_price << endl << avarage ;

}