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

int main()
{
	int price, amount;
	int sum = 0, ave = 0, i = 0;
	while(scanf("%d,%d", &price, &amount))
	{
		sum += price * amount;
		ave += amount;
		i++;
	}
	
	printf("%d\n%d\n", sum, (int)(ave / (double)i + 0.5));
	return 0;
}