#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[3000][3], b, c = 0, n, i, k = 0, m, j;
  cin >> n;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= 2; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= 2; j++) {
      if (j == 1) {
        c = c - a[i][j];
        if (c > k) k = c;
      } else {
        c = c + a[i][j];
        if (c > k) k = c;
      }
    }
  }
  cout << k;
}
