#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, sum = 0, total = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> b >> c;
    sum -= b;
    sum += c;
    total = max(total, sum);
  }
  cout << total;
  return 0;
}
