#include <cstdio>

int main(){
    int m, n;
    int total = 0, num = 0, row = 0;
    while( scanf("%d,%d\n", &m, &n) != EOF ){
        total += m * n; //ÌàzÌvÉÁZ
        num += n;       //ÌÌÊÌÉÁZ
        row++;          //üÍÌsðâ·
    }
    int ans = (int)(ave / (double)row + 0.5); //ÌÊÌ½Ï(lÌÜü·é)
    printf("%d\n%d\n", total, ans );
}