#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, max1 = -(1 << 30);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    sum -= x;
    if (sum > max1) max1 = sum;
    sum += y;
    if (sum > max1) max1 = sum;
  }
  cout << max1 << endl;
  return 0;
}
