#include <bits/stdc++.h>
using namespace std;
#define eps 1e-8
int r,num;
struct Point
{
double x,y;
Point(){}
Point(double tx,double ty){x=tx;y=ty;}
}poinr[205];
double distance(Point p1,Point p2)
{
return sqrt(pow(p1.x-p2.x,2)+pow(p1.y-p2.y,2));
}
Point buildCenter(Point p1,Point p2)
{
Point mid = Point((p1.x+p2.x)/2,(p1.y+p2.y)/2);
double angle = atan2(p1.x-p2.x,p2.y-p1.y);
double d = sqrt(r*r-pow(distance(p1,mid),2));
return Point(mid.x+d*cos(angle),mid.y+d*sin(angle));
}
int main()
{
int num,r;
while(~scanf("%d %d\n",&num,&r))
{
int i,j;
for(i=0;i<num;i++)
cin>>poinr[i].x>>poinr[i].y;
int ans = 1;
for(i=0;i<num;i++)
{
for(j=i+1;j<num;j++)
{
if(distance(poinr[i],poinr[j]) > 2.0*r) continue;
Point center = buildCenter(poinr[i],poinr[j]);
int tmp = 0;
for(int k=0;k<num;k++)
if(distance(center,poinr[k]) < 1.0*r+eps) tmp++;
ans = max(ans,tmp);
}
}
cout<<ans<<endl;
}
return 0;
}