#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w, z, sum = 0;
  int arr[1000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> w >> z;
    sum -= w;
    sum += z;
    arr[i] = sum;
  }
  sort(arr, arr + n);
  cout << arr[n - 1] << std::endl;
  return 0;
}
