#include<cstdio>
using namespace std;
int main()
{
	int m,n;
	int s=0,cnt=0; double a=0;

	while(scanf("%d,%d",&m,&n)!=EOF)
	{
		s+=m*n;
		a+=n;
		cnt++;
	}

	a=a/cnt+0.5;
	printf("%d\n%d\n",s,(int)a);
  return 0;
}