#include <bits/stdc++.h>
int main() {
  int a, b, n, i, j, max, s;
  int m[200];
  while (scanf("%d", &n) != EOF) {
    s = 0, max = 0;
    for (i = 0; i < n; i++) {
      scanf("%d %d", &a, &b);
      m[i] = s - a + b;
      s = m[i];
      if (m[i] > max) max = m[i];
    }
    printf("%d\n", max);
  }
  return 0;
}
