#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reg(i,a,b) for(int i=(a);i<=(b);i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=(b);i>=(a);i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX

void sisya(double& d){
	if(d - floor(d)>=0.5)d=ceil(d);
	else d = floor(d);
}

int main(void){
	char s[1000];
	double n = 0,m = 0;
	while(scanf("%s",s)!=EOF){
		double a,b;
		string sa,sb;
		bool p = true;
		int ls = strlen(s);
		rep(i,ls){
			if(s[i]==',')p = false;
			else{
				if(p)sa +=s[i];
				else sb += s[i];
			}
		}
		sscanf(sa.c_str(),"%lf",&a);
		sscanf(sb.c_str(),"%lf",&b);
		n += a*b; m += b;
	}
	m/=3.0;
	sisya(m);
	printf("%d\n%d\n",((int)n),((int)m));
	return 0;
}