using System;
using System.Collections.Generic;
using CompLib.Util;

public class Program
{
    private int N, K;
    private List<int>[] E;

    private int[,] Dist;

    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        K = sc.NextInt();
        E = new List<int>[N];
        for (int i = 0; i < N; i++)
        {
            E[i] = new List<int>();
        }

        int[] a = new int[N - 1];
        int[] b = new int[N - 1];
        for (int i = 0; i < N - 1; i++)
        {
            a[i] = sc.NextInt() - 1;
            b[i] = sc.NextInt() - 1;
            E[a[i]].Add(b[i]);
            E[b[i]].Add(a[i]);
        }

        Dist = new int[N, N];
        for (int i = 0; i < N; i++)
        {
            Dist[i, i] = 0;
            Go(i, i, -1);
        }

        int ans = int.MaxValue;
        if (K % 2 == 0)
        {
            for (int m = 0; m < N; m++)
            {
                int cnt = 0;
                for (int i = 0; i < N; i++)
                {
                    if (Dist[m, i] > K / 2) cnt++;
                }

                ans = Math.Min(ans, cnt);
            }
        }
        else
        {
            for (int i = 0; i < N - 1; i++)
            {
                int cnt = 0;
                for (int j = 0; j < N; j++)
                {
                    if (Math.Min(Dist[a[i], j], Dist[b[i], j]) > K / 2) cnt++;
                }

                ans = Math.Min(ans, cnt);
            }
        }

        Console.WriteLine(ans);
    }

    void Go(int root, int cur, int par)
    {
        foreach (int to in E[cur])
        {
            if (par == to) continue;
            Dist[root, to] = Dist[root, cur] + 1;
            Go(root, to, cur);
        }
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 44008