#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int T;
  cin >> T;
  int left;
  cin >> left >> left;
  T--;
  int cap = left;
  while (T--) {
    int a, b;
    cin >> a >> b;
    left = left - a;
    left = left + b;
    cap = max(left, cap);
  }
  cout << cap;
  return 0;
}
