#include<stdio.h>

int main()
{
	int tanka,ryo,souryo=0,suuryo,k=0;
	while(scanf("%d,%d",&tanka,&ryo)!=EOF)
	{
		souryo+=(tanka*ryo);
		suuryo+=ryo;
		k++;
	}
	int heikin,heikinkari;
	heikinkari=(ryo/k)*10;
	heikin=ryo/k;
	if(heikinkari%10>4)
	{
		heikin++;
	}

	printf("&d\n%.0f\n",souryo,heikin);
}