//0045

#include<cstdio>
using namespace std;

int main(void)
{
	int sum=0, count=0;
	double n=0;
	int a, b;
	while(scanf("%d,%d", &a,&b) == 2)
	{
		sum += a*b;
		count += b;
		n++;
	}
	printf("%d\n%.0f\n", sum, count/n);
	return 0;
}