#include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("lld", &x); return (x); }

int main()
{
	int totalPrice = 0;
	int totalNum = 0;
	int price;
	int num;
	int count = 0;

	while( scanf("%d,%d", &price, &num) != EOF )
	{
		totalPrice += price * num;
		totalNum += num;
		count++;
	}
	printf("%d\n%d\n", totalPrice, (int)round((double)totalNum / count));
	return (0);
}