#include<cstdio>
using namespace std;
int main(){

  int a,b,sum;
  double v,i;
  sum = 0;
  i = 0;
  v = 0;
  while(scanf("%d,%d",&a,&b) != EOF){
    
    i++;
    v += b;
    sum += a*b;
  }

  printf("%d\n%.0f\n",sum,v/i);
  return (0);
}