import std.stdio;
import std.string : chomp;
import std.conv : to;
import std.array : split;
import std.math : round;
import std.algorithm : map;



void main() {
    string[] input;
    int[] data = new int[](2);
    int num = 0, sum = 0, count = 0;

    while ((input = readln.chomp.split(",")).length != 0) {
        data[0] = input[0].to!int;
        data[1] = input[1].to!int;

        sum += data[0] * data[1];
        num += data[1];
        count++;
    }

    writeln(sum);
    writeln((num / count).round);
}