#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio( false );

	int sum = 0;
	int num = 0;
	int i = 0;

	int a, b;
	char c;
	while( cin >> a >> c >> b ) {
		sum += a*b;
		num += b;
		i += 1;
	}

	double avg = num / (double)i;
	cout << sum << '\n' << (int)(avg + 0.5) << '\n';
	return 0;
}

