#include<cstdio>
  2 using namespace std;
  3 
  4 int main(){
  5     int a,b;
  6     int total=0,num=0,row=0;
  7     
  8     while(scanf("%d,%d",&a,&b)!=EOF){
  9         total=total+a*b;
 10         num=num+a;
 11         row++;
 12     }   
 13     int ans=(int)(num/(double)row+0.5);
 14     printf("%d\n%d\n",total,ans);
 15     return 0;
 16 }   