#include<iostream>
#include<cstdio>
using namespace std;
main(){
	int t,s;
	int a=0,b=0,c=0;
	while(cin>>t){
		scanf(",%d",&s);
		a+=t*s;
		b+=s;
		c++;
	}
	s=(double)b/c+0.5;
	cout<<a<<endl<<s<<endl;
}