import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class GoodiesIoana {
	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] line = br.readLine().split(" ");
        int N = Integer.parseInt(line[0]);
		int P = Integer.parseInt(line[1]);
        int[] countEdges = new int[N];
        int countleaves = 0;

        for (int i = 0; i<N; ++i)
            countEdges[i] = 0;
        for (int i = 0; i<N-1; ++i) {
		    line = br.readLine().split(" ");
            int x = Integer.parseInt(line[0]);
		    int y = Integer.parseInt(line[1]);
            countEdges[x]++;
            countEdges[y]++;
        }
        for (int i = 0; i<N; ++i)
            if (countEdges[i] == 1) countleaves++;
		System.out.println((2*(P/countleaves) + (P % countleaves >=2? 2: P % countleaves)));
	}

	public static void main(String[] args) throws IOException {
		read();
	}
}
