#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main() {
  int n;
  string str;

  int sum = 0;
  int item_cnt = 0;
  int line_cnt = 0;

  while (getline(cin, str, ',')) {
    int a = atoi(str.c_str());
    getline(cin, str);
    int b = atoi(str.c_str());

    sum += a * b;
    item_cnt += b;
    ++line_cnt;
  }

  cout << int(sum) << endl;
  cout << int(double(item_cnt)/line_cnt+0.5) << endl;
}
