#include <bits/stdc++.h>
using namespace std;
int main() {
  int max = 0;
  int times;
  cin >> times;
  int counter = 0;
  while (times-- > 0) {
    int x;
    cin >> x;
    counter -= x;
    cin >> x;
    counter += x;
    if (counter > max) max = counter;
  }
  cout << max << endl;
  return 0;
}
