#include <bits/stdc++.h>

using namespace std;

int main() {
    int p, n;
    long long sump = 0, sumn = 0, cnt = 0;
    while (scanf("%d,%d", &p, &n) != EOF) {
        cnt++;
        sumn += n;
        sump += p * n;
    }
    cout << sump << endl;

    int aven = (int)((double)sumn / cnt + 0.5);
    cout << aven << endl;

    return 0;
}
