import std.stdio,std.string,std.conv;

int main()
{
	int sum = 0,count = 0;
	double num = 0;

	string s;
	while((s = readln.chomp).length != 0)
	{
		count++;
		string[] _s = s.split(",");
		sum += _s[0].to!int * _s[1].to!int;
		num += _s[1].to!int;
	}

	sum.writeln;
	writeln(cast(int)((num/count) + 0.5));
	return 0;
}