#include <iostream>
using namespace std;

int main() {

  int input1,input2;
  char c;

  int cnt = 0;
  int num = 0;

  while( cin >> input1 >> c >> input2 ) {

    cnt += input1*input2;
    num += input2;

  }

  int out = cnt/num;
  if ( (cnt%num) >= (num+1)/2 ) out++;

  cout << cnt << " " << out << endl;

  return 0;

}