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

int main()
{
	double p, q;
	double price = 0, quantity = 0, amount = 0;

	while (scanf_s("%lf,%lf", &p, &q) != EOF) {
		price += (p * q);
		quantity += q;
		amount++;
	}

	cout << (int)price << endl;
	cout << (int)(quantity / amount + 0.5) << endl;

	return 0;
}
