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

void main()
{
    int num, sum, selsum;
    while(true)
    {
        string line = readln;
        if(line is null)break;
        auto f = line.chomp.split(",").map!(to!int);
        sum += f[0] * f[1];
        selsum += f[1];
        ++num;
    }
    sum.writeln;
    (cast(int)(cast(real)selsum / num + 0.5)).writeln;
}