#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int ar[1002][3];
  int i = 0;
  int k = 0;
  while (i < n) {
    k = 0;
    while (k < 2) {
      scanf("%d", &ar[i][k]);
      k++;
    }
    i++;
  }
  int sum = 0;
  int passenger[10002];
  i = 0;
  k = 0;
  while (k < n) {
    sum = sum - ar[k][0] + ar[k][1];
    passenger[i] = sum;
    i++;
    k++;
  }
  i = 0;
  int cevap = 0;
  while (i < n) {
    cevap = (cevap > passenger[i]) ? cevap : passenger[i];
    i++;
  }
  printf("%d", cevap);
  return 0;
}
