#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int n,r;
int a[2001][2],i,j,k,l;
int most;
double fuck;
int you;
int main()
{
ifstream fin("fight.in");
ofstream fout("fight.out");
fin>>n>>r;
most=0;
for (i=1;i<=n;i++)
fin>>a[i][0]>>a[i][1];
for (i=1;i<=n;i++)
{
you=0;
for (j=1;j<=n;j++)
{
fuck=sqrt(pow(((double)a[i][0]-a[j][0]),2)+pow(((double)a[j][1]-a[i][1]),2));
if (fuck<=r)
you++;
}
if (you>most)
most=you;
}
fout<<most;
fin.close();
fout.close();
return 0;
}