#include
using namespace std;
int main() {
int n;
cin>>n;
int current_passengers=0,max_capacity=0;
for(int i=0;i>a>>b;
current_passengers-=a;
current_passengers+=b;
max_capacity=max(max_capacity,current_passengers);
}
cout
using namespace std;
int main() {
int n;
cin>>n;
int current_passengers=0,max_capacity=0;
for(int i=0;i>a>>b;
current_passengers-=a;
current_passengers+=b;
max_capacity=max(max_capacity,current_passengers);
}
cout