#include <stdio.h>

int main(int argc, char *argv[]){
    
    int price, num, cnt;
    int price_sum=0, num_sum=0;
    double ave=0;
    
    while(1){
        if(scanf("%d,%d", &price, &num) == EOF){
            break;
        }
        price_sum += price*num;
        num_sum += num;
        cnt++;
    }
    
    ave = (double)num_sum / cnt;
    
    printf("%d\n%.0f\n", price_sum, ave);
    
    return 0;
}