#include <stdio.h>
int main()
{
    int a, b, sum, s;
    int d=0;
    int average;
    
    while (scanf("%d,%d", &a, &b) !=EOF) {
        sum += a*b;
        s += b;
        d++;
    }
    average = (double)s / (double)d +0.5;
    printf("%d\n%d\n", sum, average);
    return 0;
}