#include <bits/stdc++.h>
using namespace std;

char s;
int p, n, t = 0, a = 0, i = 0;

int main()
{
    while (cin >> p >> s >> n) {
        t += p * n;
        a += n;
        i++;
    }

    a = (a + i / 2) / i;

    cout << t << endl << a << endl;
}

