#include<iostream>
using namespace std;

int main(){
	int x, y, sum1 = 0;
	double sum2 = 0, ave = 0, cnt = 0;
	char c;
	while(cin >> x >> c >> y){
		cnt++;
		sum1 += x*y;
		sum2 += y;
	}
	ave = (int)((sum2 / cnt) + 0.5);
	cout << sum1 << endl << ave << endl;


}