#include <stdio.h>

int main(){
  long long int a, b;
  a=b=0;
  long long int p,q;
  int n = 0;
  while(scanf("%lld,%lld", &p, &q)!=EOF){    
    a += p*q;
    b += q;
    n++;
  }
  printf("%lld\n%.0lf\n", a, b/(double)n);
}