type
point=^node;
node=record
data:longint;
next:point;
end;
var
f,g:array[1..100000]of longint;
ch,map:array[1..100000]of point;
v:array[1..100000]of boolean;
i,j,n,k,a,b,ans:longint;
p:point;
procedure make(x:longint);
var p,po:point;
begin
v[x]:=true;
p:=map[x];
while p<>nil do
begin
if v[p^.data]=false then
begin new(po);po^.data:=p^.data;
po^.next:=ch[x];ch[x]:=po;
end;
p:=p^.next;
end;
p:=ch[x];
while p<>nil do
begin make(p^.data);p:=p^.next;end;
end;
procedure dp(x:longint);
var p:point;
m2,m1:longint;
begin
p:=ch[x];
if p=nil then
begin
f[x]:=0;g[x]:=1;exit;
end;
while p<>nil do
begin dp(p^.data);p:=p^.next;end;
m1:=0;m2:=0;
p:=ch[x];
while p<>nil do
begin
if f[p^.data]>m1 then m1:=f[p^.data];
if g[p^.data]>m2 then m2:=g[p^.data];
p:=p^.next;
end;
if m2>=k then
begin ans:=ans+1;f[x]:=k;g[x]:=0;exit;end;
if (m1-1)>=m2 then
begin f[x]:=m1-1;g[x]:=0;exit;end;
g[x]:=m2+1;f[x]:=m1-1;
end;
begin
assign(input,'routea.in');reset(input);
assign(output,'routea.out');rewrite(output);
readln(n,k);
if k=0 then begin
writeln(n);close(input);close(output);halt;
end;
for i:=1 to n-1 do
begin
readln(a,b);
new(p);p^.data:=b;p^.next:=map[a];map[a]:=p;
new(p);p^.data:=a;p^.next:=map[b];map[b]:=p;
end;
fillchar(v,sizeof(v),0);
make(1);
{for i:=1 to n do
begin
p:=ch[i];
while p<>nil do
begin
write(p^.data,' ');
p:=p^.next;
end;
writeln;
end; }
ans:=0;
dp(1); //for i:=1 to n do writeln(f[i],' ',g[i]);
if g[1]>0 then writeln(ans+1) else writeln(ans);
close(input);close(output);
end.