var
n,r,max,ans,i,j:longint;
x,y:array[0..100000]of longint;
function dis(i,j:longint):double;
begin
dis:=sqrt(sqr(x[i]-x[j])+sqr(y[i]-y[j]));
end;
begin
assign(input,'fight.in'); reset(input);
assign(output,'fight.out'); rewrite(output);
readln(n,r);
for i:=1 to n do read(x[i],y[i]);
max:=-maxlongint;
for i:=1 to n do
begin
ans:=0;
for j:=1 to n do
if dis(i,j)<=r then inc(ans);
if ans>max then max:=ans;
end;
writeln(max);
close(input);
close(output);
end.