#include <bits/stdc++.h>
int main() {
  int a, b, n;
  int c = 0;
  int m = 0;
  int i = 0;
  scanf("%d", &n);
  while (i < n) {
    scanf("%d", &a);
    scanf("%d", &b);
    c = c - a + b;
    if (m < c) {
      m = c;
    }
    i++;
  }
  printf("%d", m);
  return 0;
}
