/*
	0045:Sum and Average
*/
#include	<iostream>
#include	<cstdio>

using namespace std;

int round(double);

int main(void) {
	int sum_sale = 0, sum_count = 0, c = 0, buf_sale, buf_count;
	
	while(scanf("%d,%d", &buf_sale, &buf_count) != EOF) {
		sum_sale += buf_sale * buf_count;
		sum_count += buf_count;
		c++;
	}
	cout << sum_sale << endl << round((double)sum_count / c) << endl;
}

int round(double x) {
	return (int)(x+0.5);
}