#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 (1) {
		if (scanf_s("%d,%d", &a, &b) == EOF) {
			ave = (double)sum2 / cou;
			printf("%d\n%.0f", sum, ave);
			break;
		}
		sum += a * b; sum2 += b;
		++cou;
	}
}