import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	int sum, avr, cnt;
	foreach (line; stdin.byLine) {
		auto nm = line.split(",").map!(to!int);
		sum += nm[0] * nm[1];
		avr += nm[1];
		cnt++;
	}
	writeln(sum);
	writeln((1.0*avr/cnt).nearbyint);
}