// Задача "Травля тараканов"
// Девятая индивидуальная Интернет-олимпиада сезона 2010-2011
// Авторы задачи: Павел Кротков, Андрей Комаров
// Автор решения: Владимир Ульянцев, ulyantsev@rain.ifmo.ru

uses
    math;
type
    int = longint;

const
    MAXN = 200000;
    MAXK = 200000;
var
    n, k, i, v, u, m, ans : int;
    was : array [1..MAXN] of boolean;
    height : array [1..MAXN] of int;

    t, next : array [1..2 * (MAXN - 1)] of int;
    first : array [1..MAXN] of int;
    cnt : int;

procedure add_edje(v, u : int);
begin
    inc(cnt);
    t[cnt] := u;
    next[cnt] := first[v];
    first[v] := cnt;
end;

var
    uncolored_height, dst : array [1..MAXN] of int;

procedure dfs(v : int);
var
    i, u : int;
begin
    was[v] := true;    
    uncolored_height[v] := 0;
    dst[v] := 2 * MAXN;
    
    i := first[v];
    while i > 0 do begin
        u := t[i];
        if (not was[u]) then begin
            dfs(u);
        end;

        dst[v] := min(dst[v], dst[u] + 1);
        i := next[i];
    end;

    i := first[v];
    while i > 0 do begin
        u := t[i];
        
        if (uncolored_height[u] > k - dst[v]) then begin
            uncolored_height[v] := max(uncolored_height[v], uncolored_height[u] + 1);
        end;

        i := next[i];
    end;

    if (uncolored_height[v] = k) then begin
        uncolored_height[v] := 0;
        dst[v] := 0;
        ans := ans + 1;
    end;    
end;

begin
    reset(input, 'cockroach.in');
    
    read(n, k);
    assert((1 <= n) and (n <= MAXN));
    assert((0 <= k) and (k <= MAXK));
    m := 2 * k + 1;

    cnt := 0;
    fillchar(first, sizeof(first), 0);

    for i := 1 to n - 1 do begin
        read(v, u);
        add_edje(v, u);
        add_edje(u, v);
    end;

    fillchar(was, sizeof(was), 0);

    ans := 0;
    dfs(1);

    rewrite(output, 'cockroach.out');
    writeln(ans);
end.
