#include<iostream>
#include<string>
#include<cstdlib>
#include<typeinfo>

using namespace std;

int main() {
	int i = 0;
	string price_num, price, num; int place; int total_price = 0, total_num = 0; int dummy;
	while (cin >> price_num) {
		i++;  price = ""; num = "";
		place = price_num.find(',');
		for (int i = 0; i < place; i++) {
			price += price_num[i];
		}
		for (int i = place+1; i < price_num.length(); i++) {
			num += price_num[i];
		}
		dummy= atoi(num.c_str());
		total_price+=atoi(price.c_str())*dummy;
		total_num += dummy;
	}
	cout << total_price << endl;
	int ans = total_num / i;
	cout << ans << endl;
	return 0;
}