#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, max = 0, kol = 0;
  cin >> n;
  int k[n][2];
  for (int i = 0; i < n; i++) cin >> k[i][0] >> k[i][1];
  for (int j = 0; j < n; j++) {
    kol = kol - k[j][0];
    kol = kol + k[j][1];
    if (max < kol) max = kol;
  }
  cout << max;
  return 0;
}
