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

int main() {
	int a, b, sum=0, ave=0, n=0;
	while (scanf("%d,%d", &a, &b)!=EOF) {
		n++;
		sum+=a*b;
	}
	ave=(int)((double)sum/(double)n + 0.5);
	cout<<sum<<endl<<ave<<endl;
	return 0;
}