#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){

	int a,b;
	double sum=0,ave=0,cnt=0;
	char str;
	while(scanf("%d%c%d",&a,&str,&b)!=EOF){
        sum+=a*b;
        ave+=b;
        cnt++;


	}

    printf("%.0lf\n%.0lf",sum,ave/cnt);

	return 0;
}