#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int a = 0, s = 0, n = 0,b,c;
	while (scanf("%d,%d", &b, &c) + 1){
		s += (b*c);
		++n;
		a += c;
	}
	a /= n;
	cout << s << endl << a << endl;
}