#include <bits/stdc++.h>
using namespace std;
int main() {
  int x = 0, final = 0, highest = 0;
  int temp = 0;
  cin >> x;
  for (int i = 0; i < x; i++) {
    cin >> temp;
    final -= temp;
    cin >> temp;
    final += temp;
    if (final > highest) highest = final;
  }
  cout << highest;
}
