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

int main() {
  int a, b, ans1 = 0, n = 0;
  double ans2 = 0;
  char c;
  while (cin >> a >> c >> b) {
    ans1 += a * b, ans2 += b, ++n;
  }
  ans2 = round(ans2 / n);
  cout << ans1 << endl << ans2 << endl;
}

