#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
using namespace std;



int main(){
	int a,b,c=0,sa=0,sb=0;
	while(scanf("%d,%d",&a,&b) != EOF){
		c++;
		sa += a*b;
		sb += b;
	}
	printf("%d\n%d\n",sa,(int)round( (double)(sb)/(double)(c)));
	
	return 0;
}
