#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int price, mount;
	char c;
	int sum_price, sum_mount ,cnt;
	while(cin >> price >> c >> mount){
		sum_price += price * mount;
		sum_mount += mount;
		cnt++;
	}
	int average = sum_mount / cnt;
	cout << sum_price << '?\n' << average << '?\n';
}