import std.stdio : readln, writeln, chomp, stdin;
import std.conv : to;
import std.string : split;
import std.algorithm : min, max;

void solve()
{
	int sum, num, count;
	
	while(true){
		string str = readln.chomp;
		
		if(stdin.eof())	break;
		
		string[] sp = str.split(",");
		int v = sp[0].to!int;
		int m = sp[1].to!int;
		
		++count;
		sum += v*m;
		num += m;
	}
	writeln = sum;
	writeln = cast(int)((num / cast(double)count) + .5);
}

void main()
{
	solve();
}