#include <stdio.h>
#include <math.h>
int main(){
	int a,b,gou=0,kei=0,cnt=0;
	double avg;
	while(scanf("%d,%d",&a,&b)!=EOF){
        kei=kei+b;
        gou = gou + a*b;
        cnt++;        
    }
    avg=1.0*kei/cnt;
	printf("%d\n%0.0f",gou,avg);
	return 0;
}