#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
    int a, b, sum1 = 0, sum2 = 0, avg, p = 0;
    while(scanf("%d,%d", &a, &b) != EOF) {
        if (a == 0) break;
        sum1 += a*b;
        sum2 += b;
        p++;
    }
    avg = (sum2 % p) ? sum2 / p + 1 : sum2 / p;
    printf("%d\n%d\n", sum1, avg);

    return 0;
}

