import java.util.*

/**
 * Created by niyaz on 07.06.17.
 */

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val k = sc.nextInt()
    val edges = Array(n, { mutableListOf<Int>() })

    fun dfs(v: Int, pv: Int, d: Int): Int {
        var ans = if (2 * d > k) 1 else 0
        for (to in edges[v]) {
            if (to == pv) continue
            ans += dfs(to, v, d + 1)
        }
        return ans
    }

    for (i in 1..n - 1) {
        val v = sc.nextInt() - 1
        val u = sc.nextInt() - 1
        edges[v].add(u)
        edges[u].add(v)
    }
    if (k % 2 == 0) {
        println((0..n - 1).map { dfs(it, -1, 0) }.min())
    } else {
        println(
        (0..n - 1).map { v ->
            edges[v].filter { v < it }.map { dfs(v, it, 0) + dfs(it, v, 0) }.min() ?: Int.MAX_VALUE
        }.min()
        )
    }
}
