#include <stdio.h>
#include <math.h>

using namespace std;

int main(){
	double sum = 0,am_sum = 0,count = 0,value,amount;

	while(scanf("%lf,%lf",&value,&amount)!=EOF){
		sum += value*amount;
		am_sum += amount;
		count++;
	}

	printf("%.0lf\n%.0lf\n",sum,am_sum/count);

	return 0;
}