#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	long long  t, s, sum, iave, loop, m;

	while (scanf("%d,%d", &t, &s) != EOF){
		sum += t * s;
		loop++;
		m += s;
	}
	iave =  m * 1.0 / loop + 0.5;
	cout << sum << endl << iave << endl;
	return (0);
}