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

int main(){
  int t, n, tall, nall, cnt = 0;
  double ave;
  char ch;
  while (cin >> t >> ch >> n) {
    tall += t * n;
    nall += n;
    cnt++;
  }
  ave = nall / cnt;
  cout << tall << " " << round(ave + 0.5) << endl;
}
