#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long double PI = acos((long double)-1);
void solve(int tc = 1) {
  int N;
  cin >> N;
  int first, second;
  int ans = 0, mx = 0;
  while (N--) {
    cin >> first >> second;
    ans -= first;
    ans += second;
    if (ans > mx) {
      mx = ans;
    }
  }
  cout << mx << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int tc = 1;
  for (int t = 0; t < tc; t++) solve(t);
  return 0;
}
