#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int up, down;
  int people = 0;
  int max = 0;
  cin >> n;
  while (n--) {
    cin >> up >> down;
    people = people - up + down;
    if (people > max) max = people;
  }
  cout << max << endl;
  return 0;
}
