#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int d = 0, e = 0, q;
  for (int i = 0; i < n; i++) {
    int b, c;
    cin >> b >> c;
    d = d - b + c;
    e = max(e, d);
  }
  cout << e;
}
