#include <iostream>
using namespace std;
int n;
long long sum=0;
int relu(int m){
if(m>0) return m;
else return 0;
}
int main(){
cin>>n;
for (int i = 0;i<n;i++){
int w,x;
cin>>w>>x;
sum += w*x;
}
sum = relu(sum);
cout<<sum<<endl;
return 0;
}