#include <stdio.h>

int main() {
    double n = 0, m = 0, s = 0;
    int x, y;
    while (scanf("%d,%d", &x, &y) != EOF) {
        s += (double)x*y;
        n += y;
        m += 1;
    }
    printf("%.0f\n", s);
    printf("%.0f\n", n / m);
    return 0;
}