#include "iostream"
#include "algorithm"
#include "vector"
#include "set"
#include "map"
#include "cstring"
#include "string"
#include "vector"
#include "cassert"
#include "queue"
#include "cstdio"
#include "cstdlib"
#include "ctime"
#include "cmath"
#include "bitset"
using namespace std;
typedef long long ll;
typedef pair < int, int > ii;
const int N = 1e5 + 5;
int n, d, k;
ii a[N];
int ans[N];
vector < int > up[N];
class tree{ public:
vector < int > vs, fen;
void add(int x) {
vs.push_back(x);
}
void init() {
sort(vs.begin(), vs.end());
vs.resize(unique(vs.begin(), vs.end()) - vs.begin());
fen.resize(vs.size() + 1, n + 1);
}
int id(int x) {
return upper_bound(vs.begin(), vs.end(), x) - vs.begin();
}
int get(int x) {
int res = n + 1;
for(x = id(x); x; x -= x & -x)
res = min(res, fen[x]);
return res;
}
void upd(int x, int v) {
for(x = id(x); x < fen.size(); x += x & -x)
fen[x] = min(fen[x], v);
}
};
tree data[N << 1];
void addT(int i) {
int x = a[i].first + N;
while(x >= 1) {
data[x].add(a[i].second);
x >>= 1;
}
}
void updT(int i) {
int x = a[i].first + N;
while(x >= 1) {
data[x].upd(a[i].second, i);
x >>= 1;
}
}
int getT(int x, int y) {
int res = n + 1;
for(int l = x + N, r = y + N; l <= r; l = (l + 1) >> 1, r = (r - 1) >> 1) {
if(l & 1) res = min(res, data[l].get(y));
if(~r & 1) res = min(res, data[r].get(y));
}
return res;
}
int go(int l, int r) {
int i = getT(l, r);
if(i > n)
return 0;
return a[i].second - a[i].first + 1 + go(l, a[i].first - 1) + go(a[i].second + 1, r);
}
int main () {
scanf("%d %d %d", &n, &d, &k);
for(int i = 1; i <= n; i++) {
scanf("%d %d", &a[i].first, &a[i].second);
up[a[i].second - a[i].first + 1].push_back(i);
}
for(int i = 1; i <= n; i++)
addT(i);
for(int i = 1; i < N + N; i++)
data[i].init();
for(int len = d; len >= 1; len--) {
if(up[len].empty()) {
ans[len] = ans[len + 1];
continue;
}
for(auto i : up[len]) {
updT(i);
}
ans[len] = go(1, d);
}
for(int i = 1; i <=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ICBpbnQgZ2V0KGludCB4KSB7CiAgICAgICAgaW50IHJlcyA9IG4gKyAxOwogICAgICAgIGZvcih4ID0gaWQoeCk7IHg7IHggLT0geCAmIC14KQogICAgICAgICAgICByZXMgPSBtaW4ocmVzLCBmZW5beF0pOwogICAgICAgIHJldHVybiByZXM7CiAgICB9CiAgICB2b2lkIHVwZChpbnQgeCwgaW50IHYpIHsKICAgICAgICBmb3IoeCA9IGlkKHgpOyB4IDwgZmVuLnNpemUoKTsgeCArPSB4ICYgLXgpCiAgICAgICAgICAgIGZlblt4XSA9IG1pbihmZW5beF0sIHYpOwogICAgfQp9OwoKdHJlZSBkYXRhW04gPDwgMV07Cgp2b2lkIGFkZFQoaW50IGkpIHsKICAgIGludCB4ID0gYVtpXS5maXJzdCArIE47CiAgICB3aGlsZSh4ID49IDEpIHsKICAgICAgICBkYXRhW3hdLmFkZChhW2ldLnNlY29uZCk7CiAgICAgICAgeCA+Pj0gMTsKICAgIH0KfQoKdm9pZCB1cGRUKGludCBpKSB7CiAgICBpbnQgeCA9IGFbaV0uZmlyc3QgKyBOOwogICAgd2hpbGUoeCA+PSAxKSB7CiAgICAgICAgZGF0YVt4XS51cGQoYVtpXS5zZWNvbmQsIGkpOwogICAgICAgIHggPj49IDE7CiAgICB9Cn0KCmludCBnZXRUKGludCB4LCBpbnQgeSkgewogICAgaW50IHJlcyA9IG4gKyAxOwogICAgZm9yKGludCBsID0geCArIE4sIHIgPSB5ICsgTjsgbCA8PSByOyBsID0gKGwgKyAxKSA+PiAxLCByID0gKHIgLSAxKSA+PiAxKSB7CiAgICAgICAgaWYobCAmIDEpIHJlcyA9IG1pbihyZXMsIGRhdGFbbF0uZ2V0KHkpKTsKICAgICAgICBpZih+ciAmIDEpIHJlcyA9IG1pbihyZXMsIGRhdGFbcl0uZ2V0KHkpKTsKICAgIH0KICAgIHJldHVybiByZXM7Cn0KCmludCBnbyhpbnQgbCwgaW50IHIpIHsKICAgIGludCBpID0gZ2V0VChsLCByKTsKICAgIGlmKGkgPiBuKQogICAgICAgIHJldHVybiAwOwogICAgcmV0dXJuIGFbaV0uc2Vjb25kIC0gYVtpXS5maXJzdCArIDEgKyBnbyhsLCBhW2ldLmZpcnN0IC0gMSkgKyBnbyhhW2ldLnNlY29uZCArIDEsIHIpOwp9CgppbnQgbWFpbiAoKSB7CiAgICAKICAgIHNjYW5mKCIlZCAlZCAlZCIsICZuLCAmZCwgJmspOwogICAgCiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG47IGkrKykgewogICAgICAgIHNjYW5mKCIlZCAlZCIsICZhW2ldLmZpcnN0LCAmYVtpXS5zZWNvbmQpOwogICAgICAgIHVwW2FbaV0uc2Vjb25kIC0gYVtpXS5maXJzdCArIDFdLnB1c2hfYmFjayhpKTsKICAgIH0KICAgIAogICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyBpKyspCiAgICAgICAgYWRkVChpKTsKICAgIAogICAgZm9yKGludCBpID0gMTsgaSA8IE4gKyBOOyBpKyspCiAgICAgICAgZGF0YVtpXS5pbml0KCk7CiAgICAKICAgIGZvcihpbnQgbGVuID0gZDsgbGVuID49IDE7IGxlbi0tKSB7CiAgICAgICAgaWYodXBbbGVuXS5lbXB0eSgpKSB7CiAgICAgICAgICAgIGFuc1tsZW5dID0gYW5zW2xlbiArIDFdOwogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICB9CiAgICAgICAgZm9yKGF1dG8gaSA6IHVwW2xlbl0pIHsKICAgICAgICAgICAgdXBkVChpKTsKICAgICAgICB9CiAgICAgICAgYW5zW2xlbl0gPSBnbygxLCBkKTsKICAgIH0KICAgIAogICAgZm9yKGludCBpID0gMTsgaSA8PSBrOyBpKyspIHsKICAgICAgICBpbnQgeDsKICAgICAgICBzY2FuZigiJWQiLCAmeCk7CiAgICAgICAgcHJpbnRmKCIlZFxuIiwgYW5zW3hdKTsKICAgIH0KICAgIAogICAgcmV0dXJuIDA7CiAgICAKfQ==