#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 101
#define MIN -100001
#define ABC 26

int main(void)
{
	double ave;
	int  sum = 0, sum2 = 0, cou = 0, a, b;
	while (scanf_s("%d,%d", &a, &b) != EOF) {
		if (a == b && a == 0) break;
		sum += a * b; sum2 += b;
		++cou;
	}
	ave = (double)sum2 / cou;
	printf("%d\n%.0f\n", sum,ave);
}