try: input=raw_input
except: pass

import sys

N,P = map(int,input().split())
countedges = [0] * N
countleaves = N
for i in range(N-1):
    x,y=map(int,input().split())
    if countedges[x] == 1: 
        countleaves-=1
    if countedges[y] == 1:
        countleaves-=1
    countedges[x]+=1
    countedges[y]+=1

mod = P%countleaves
if mod>=2:
    mod = 2

print(2*(P//countleaves)+mod)
