#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int MOD = 1e9 + 7;
int X[maxn], a[maxn], val[maxn];
int main() {
  int N, H;
  int prex = 0, prey = 0;
  cin >> N >> H;
  H--;
  int x, y;
  for (int i = 1; i <= N; i++) {
    cin >> x >> y;
    val[i] = y - x;
    X[i] = x;
    a[i] = x - prey;
    prex = x, prey = y;
  }
  for (int i = 1; i <= N; i++) a[i] += a[i - 1];
  int Max = 0;
  int p1 = 0, p2 = 0;
  while (1) {
    while (a[p2] - a[p1] <= H && p2 < N) p2++;
    Max = max(Max, X[p2 - 1] - X[p1] + val[p2 - 1] + H - (a[p2 - 1] - a[p1]));
    while (a[p2] - a[p1] > H && p1 < N) p1++;
    Max = max(Max, X[p2] - X[p1] + val[p2] + H - (a[p2] - a[p1]));
    if (p2 == N || p1 == N) break;
  }
  cout << Max + 1 << endl;
}
