#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr1[n][2], arr2[n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> arr1[i][j];
    }
  }
  arr2[0] = arr1[0][0] + arr1[0][1];
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 2; j += 2) {
      arr2[i] = arr2[i - 1] - arr1[i][j] + arr1[i][j + 1];
    }
  }
  int maxx = arr2[0];
  for (int i = 0; i < n; i++) {
    if (maxx < arr2[i]) maxx = arr2[i];
  }
  cout << maxx;
  return 0;
}
