#include <bits/stdc++.h>
using namespace std;
struct pt {
  int num;
  int time;
} s1[110], tmp;
int main() {
  int n, s, t = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> s1[i].num >> s1[i].time;
  }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      if (s1[i].num < s1[j].num) {
        tmp = s1[i];
        s1[i] = s1[j];
        s1[j] = tmp;
      }
    }
  for (int i = 0; i < n; i++) {
    t += s - s1[i].num;
    s = s1[i].num;
    if (t < s1[i].time) t = s1[i].time;
    if (i == n - 1) t += s1[i].num;
  }
  cout << t << endl;
}
