#include <bits/stdc++.h>
using namespace std;
struct People {
  int f;
  int t;
} p[105];
bool Comp(People a, People b) { return a.f > b.f; }
int main() {
  int n, i, s, cf, time = 0;
  cin >> n >> s;
  for (i = 1; i <= n; i++) cin >> p[i].f >> p[i].t;
  sort(p + 1, p + n + 1, Comp);
  cf = s;
  for (i = 1; i <= n; i++) {
    time = time + (cf - p[i].f);
    if (p[i].t > time) time = time + (p[i].t - time);
    cf = p[i].f;
  }
  time = time + p[n].f;
  cout << time << endl;
  return 0;
}
