#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int w, score;
int y = 0;
for(int i = 0; i < n; i++) {
cin >> w >> score;
y += w * score;
}
if(y >= 0) cout << y;
else cout << 0;
}
12-04
921
11-13
969