#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int sum = 0,n = 0,i;
  for(i=0;;i++){
    int a,b;
    if(scanf("%d,%d",&a,&b) == EOF) break;
    sum+=a*b;
    n+=b;
  }
  printf("%d\n%.0lf\n",sum,(double)n/i);
  return 0;
}