#include <bits/stdc++.h>
using namespace std;
struct node {
  int f;
  int t;
} p[100000];
bool cmp(const struct node &a, const struct node &b) { return a.f > b.f; }
int main() {
  int n, t, i, q, ans, j, y;
  scanf("%d%d", &n, &t);
  for (i = 0; i < n; i++) scanf("%d%d", &p[i].f, &p[i].t);
  sort(p, p + n, cmp);
  q = t;
  ans = 0;
  for (i = 0; i < n; i++) {
    for (j = i; j < n; j++) {
      p[j].t -= q - p[i].f;
      if (p[j].t < 0) p[j].t = 0;
    }
    y = q - p[i].f + p[i].t;
    ans += y;
    for (j = i + 1; j < n; j++) {
      p[j].t -= p[i].t;
      if (p[j].t < 0) p[j].t = 0;
    }
    q = p[i].f;
  }
  ans += q;
  printf("%d\n", ans);
}
