#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;


int main(){

  int a, b;
  int sum = 0;
  int num = 0;
  int n = 0;
  while( scanf("%d,%d", &a, &b) != EOF ){

    sum += a * b;
    num += b;
    n++;
  }
  double ave = num / n;
  ave += 0.5;
  cout << sum << endl;
  cout << ave / n << endl;

  return 0;
}