#include	<iostream>
#include	<cstdio>

using namespace std;

int main(void) {
	int i = 0, sumPrice = 0, sumCount = 0;
	while(1) {
		int price, count;
		if(2 != scanf("%d,%d", &price, &count) )	{ break; }
		i++;
		sumPrice += price*count;
		sumCount += count;
	}
	
	printf("%d\n%.0f\n", sumPrice, (double)sumCount / i);
	
	return 0;
}