#include <stdio.h>

int main(){
	int m,n,sum=0, a=0;
	double ave=0;

	while( scanf("%d,%d", &m, &n) != EOF ){
		if(m==n)break;
		a++;
		sum += n*m;
		ave += n;
	}
	ave /= (double)a;
	ave = (ave*100-(int)(ave*100)%10)/100;
	printf("%d\n%.0f\n", sum, ave);
	return 0;
}