#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

int main() {
  int e, c, sum, num, n;
  sum = num = n = 0;

  while(scanf("%d,%d", &e, &c) != EOF) {
    ++n;
    sum += e*c;
    num += c;
  }
  printf("%d\n%.0f\n", sum, (double)num/n);
  return 0;
}