#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    float cost=0, sumcost=0, soldnum=0,sumsoldnum=0, num=0;
    char t;
    while(1)
    {
        cin>>cost>>t>>soldnum;
        if(cin.eof())break;
        sumcost+= cost*soldnum;
        sumsoldnum += soldnum;
        num += 1;
    }
    printf("%.0f\n%.0f\n",sumcost,sumsoldnum/num);

    return 0;
}