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

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

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