#include <bits/stdc++.h>
using namespace std;
void testcase() {
  int k, i, o;
  cin >> k;
  int b = 0, f = b;
  ;
  for (int j = 1; j <= k; j++) {
    cin >> o >> i;
    b = b - o;
    b = b + i;
    if (f <= b) f = b;
  }
  cout << f << endl;
}
int main() {
  testcase();
  return 0;
}
