#include <bits/stdc++.h>
using namespace std;

int main(){
    int n=0, sum=0, ave=0;
    int a, b;
    while(scanf("%d,%d",&a,&b) > 0){
        n++;
        sum += a*b;
        ave += b;
    }
    ave = int(round(double(ave)/n));
    cout << sum << '\n' << ave << endl;
    return 0;
}

