#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, biggest = 0;
  scanf("%d", &n);
  int a[2 * n], s[n];
  for (i = 0, j = 0; i < 2 * n; i = i + 2, j++) {
    scanf("%d", &a[i]);
    scanf("%d", &a[i + 1]);
  }
  s[0] = a[0] + a[1];
  for (j = 1, i = 3; j < n; j++, i = i + 2) {
    s[j] = s[j - 1] + a[i] - a[i - 1];
  }
  for (i = 0; i < n; i++) {
    if (s[i] > biggest) {
      biggest = s[i];
    }
  }
  printf("%d\n", biggest);
  return 0;
}
