#include <bits/stdc++.h>
using namespace std;

typedef double NUM;
const NUM EPS = 1e-12,MAGIC = 2.71828e18;

inline NUM sqr(NUM a){
	return a*a;
}

inline NUM cmp(NUM a,NUM b) {
	return fabs(a-b)>=EPS+fabs(a)*EPS?a-b:0;
}

struct VEC {
NUM x,y;
} NOVEC = {MAGIC,MAGIC};

struct RAY {
VEC u,v;
} NORAY = {NOVEC,NOVEC};

struct CIR {
	VEC u;
	NUM r;
} NOCIR = {NOVEC,MAGIC};

inline NUM sqr(const VEC &a) {
	return sqr(a.x)+sqr(a.y);
}

inline double abs(const VEC &a) {
	return sqrt(sqr(a));
}

inline NUM operator *(const VEC &a, const VEC &b) {
	return a.x*b.y-a.y*b.x;
}

inline VEC operator *(const VEC &a, NUM u) {
	return (VEC) {
		a.x*u,a.y*u
	};
}

inline VEC operator *(NUM u, const VEC &a) {
	return (VEC) {
		u*a.x,u*a.y
	};
}

inline VEC operator -(const VEC &a, const VEC &b) {
	return (VEC) {
		a.x-b.x,a.y-b.y
	};
}

inline VEC operator +(const VEC &a, const VEC &b) {
	return (VEC) {
		a.x+b.x,a.y+b.y
	};
}

inline VEC operator ~(const VEC &a) {
	return (VEC) {
		-a.y,a.x
	};
}

VEC resize(const VEC &a,NUM u)
{
	return u/abs(a)*a;
}

int relation(const VEC &p, const CIR &c)
{
	NUM at = cmp(sqr(c.r),sqr(c.u-p));
	return at?at<0?0:1:2;
}

RAY tangent(const VEC &p, const CIR &c)
{
	NUM l=sqr(p-c.u),e=cmp(l,c.r*c.r);
	if (e<0) return NORAY;
	NUM x=c.r/sqrt(l),y=sqrt(e/l);
	VEC s=resize(p-c.u,1),t=~s;
	RAY lr = {	c.u+c.r*x*s-c.r*y*t,
				c.u+c.r*x*s+c.r*y*t
			};
	return lr;
}

NUM cmp_side(const VEC &a,const VEC &b) {
	return cmp(a.x*b.y,a.y*b.x);
}

inline NUM cmp(const VEC &a,const VEC &b) {
	NUM at=cmp(a.x,b.x);
	return !at?cmp(a.y,b.y):at;
}

inline bool operator ==(const VEC &a,const VEC &b) {
	return !cmp(a,b);
}

inline bool operator ==(const RAY &a,const RAY &b) {
	return (a.u==b.u)&&(a.v==b.v);
}

bool in(RAY a,VEC b)
{
	int flag=1;
	if (a==NORAY) return 1;
	if (cmp_side(a.u,a.v)>=EPS) return 0;
	if (cmp_side(a.u,b)>=EPS) flag=0;
	if (cmp_side(a.v,b)<=-EPS) flag=0;
	return flag;
}

RAY merge(RAY a,RAY b)
{
	RAY ret;
	if (a==NORAY) return b;
	if (b==NORAY) return a;
	if (cmp_side(a.u,a.v)>=EPS) return a;
	if (cmp_side(a.u,b.u)>=EPS) ret.u=a.u;
	else ret.u=b.u;
	if (cmp_side(a.v,b.v)<=-EPS) ret.v=a.v;
	else ret.v=b.v;
	if (cmp_side(a.u,ret.v)>=EPS) return (RAY){(VEC){1,0},(VEC){0,1}};
	if (cmp_side(a.v,ret.u)<=-EPS) return (RAY){(VEC){1,0},(VEC){0,1}};
	if (cmp_side(b.u,ret.v)>=EPS) return (RAY){(VEC){1,0},(VEC){0,1}};
	if (cmp_side(b.v,ret.u)<=-EPS) return (RAY){(VEC){1,0},(VEC){0,1}};
	return ret;
}

int n,d;
VEC p[2200];
int e[2200][2200],dis[2100];

int main()
{
	freopen("kingdom.in","r",stdin);
	freopen("kingdom.out","w",stdout);
	scanf("%d%d",&n,&d);
	memset(e,0,sizeof(e));
	for (int i=0;i<n;i++){
		scanf("%lf%lf",&p[i].x,&p[i].y);
	}
	for (int i=0;i<n;i++)
		for (int j=i+1;j<n;j++) e[i][j]=1;
	for (int i=0;i<n;i++)
	{
		RAY ret = NORAY;
		for (int j=i+1;j<n;j++)
		{
			if (!in(ret,p[j]-p[i])) e[i][j]=0;
			if (!relation(p[i],(CIR){p[j],d})){
				RAY t = tangent(p[i],(CIR){p[j],d});
				t.u=t.u-p[i];t.v=t.v-p[i];
				ret = merge(ret,t);/*
				cout << "T = " << t.u.x << " " << t.u.y << endl;
				cout << "T = " << t.v.x << " " << t.v.y << endl;
			}
			cout << "ret.u = " << ret.u.x << " " << ret.u.y << endl;
			cout << "ret.v = " << ret.v.x << " " << ret.v.y << endl;
		}
		cout << endl;*/
		}}
	}
	for (int i=n-1;i>=0;i--){
		RAY ret = NORAY;
		for (int j=i-1;j>=0;j--)
		{
			if (!in(ret,p[j]-p[i])) e[j][i]=0;
			if (!relation(p[i],(CIR){p[j],d})){
				RAY t = tangent(p[i],(CIR){p[j],d});
				t.u=t.u-p[i];t.v=t.v-p[i];
				ret = merge(ret,t);/*
				cout << "T = " << t.u.x << " " << t.u.y << endl;
				cout << "T = " << t.v.x << " " << t.v.y << endl;
			}
			cout << "ret.u = " << ret.u.x << " " << ret.u.y << endl;
			cout << "ret.v = " << ret.v.x << " " << ret.v.y << endl;
		}
		cout << endl;*/
		}}
	}
//	for (int i=0;i<n;i++)
//		for (int j=0;j<n;j++) printf("%d%c",e[i][j],"\n "[j<n-1]);
	for (int i=0;i<n;i++) dis[i]=i;
	for (int i=0;i<n;i++)
	{
		for (int j=i+1;j<n;j++)
		if (e[i][j])
			if (dis[j]>dis[i]+1) dis[j]=dis[i]+1;
	}
	printf("%d\n",dis[n-1]+1);

//	printf("%lf\n",cmp_side((VEC){1,0},(VEC){0,1}));
}
