#include <iostream> //#include <bits/stdc++.h> #include <string> using namespace std; int main() { int number; cin>>number; int sum=0; int a,b; while(number--) { cin>>a>>b; sum+=a*b; } sum=max(sum,0); cout<<sum; }