#include <bits/stdc++.h>
using namespace std;
long n, s, t = 0, fi[1010], ti[1010];
int main() {
  cin >> n >> s;
  for (int i = 1; i <= n; i++) cin >> fi[i] >> ti[i];
  for (int i = n; i >= 1; i--) {
    t += s - fi[i];
    if (t < ti[i]) t += ti[i] - t;
    s = fi[i];
  }
  cout << t + s << endl;
  return 0;
}
