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

int main()
{
  int a, b, sum = 0, i = 0, c = 0;
  while (scanf("%d,%d", &a, &b)){
    sum += a * b;
    i++;
    c += b;
  }
  cout << sum << endl << c / i << endl;
  return (0);
}