#include <iostream>
using namespace std;

int main() {
  int a, b;
  char ch;
  int sum = 0;
  int num = 0;
  
  while(cin>>a>>ch>>b) {
    sum += a*b;
    num += b;
  }
  
  cout << sum << endl << num << endl;
  return 0;
}