using namespace std;
int n;
int sc,w;
int main(){ cin >> n; int y=0; while(n–){ cin >> w >> sc; y+= sc*w; } if(y<0) cout << “0” << endl; else cout << y << endl; }