#include<iostream>

using namespace std;

int main(){
	
	int price , num;
	int tn = 0, sp = 0;
	
	while( cin >> price >> num ) {
		
		sp += price * num;
		tn += num;
	}
	cout << sp << "\n";
	cout << tn << "\n";
		
  	return 0;
}
