#include
//#include
#include
using namespace std;
int rastojanie(int a, int b) {
return abs(a-b);
}
string levo_ili_desno(pair platforma, pair otsecka) {
if(otsecka.first otsecka, pair platforma) {
if(otsecka.firstplatforma.second) {
return false;
}
if(otsecka.first>=platforma.first and otsecka.second<=platforma.second) {
return true;
}
if(levo_ili_desno(platforma,otsecka)=="levo") {
if(rastojanie(platforma.first,otsecka.second)>=rastojanie(platforma.first,otsecka.first)) {
return true;
}
}
else {
if(rastojanie(otsecka.first,platforma.second)>=rastojanie(otsecka.second,platforma.second)) {
return true;
}
}
return false;
}
int main(){
int N,L;
pair platforma;
cin>>N>>L;
vector> otsecka;
platforma.first = 0;
platforma.second = L;
for(int i = 0; i>x>>y;
otsecka.push_back(make_pair(x,y));
}
int brojac = 0;
for(int i = 0; i -5000 and dali_moze(otsecka[j], platforma)) {
brojac++;
platforma.first = min(platforma.first, otsecka[j].first);
platforma.second = max(platforma.second, otsecka[j].second);
otsecka[j].first = -5000;
}
}
}
cout<