Problem: You are given a tree $T$ and an integer $K$. You can choose arbitrary distinct two vertices $u$ and $v$ on $T$. Let $P$ be the simple path between $u$ and $v$. Then, remove vertices in $P$, and edges such that one or both of its end vertices is in $P$ from $T$. Your task is to choose $u$ and $v$ to maximize the number of connected components with $K$ or more vertices of $T$ after that operation.



Input

The input consists of a single test case formatted as follows.


$N$ $K$
$u_1$ $v_1$
:
$u_{N-1}$ $v_{N-1}$


The first line consists of two integers $N, K$ ($2 \leq N \leq 100,000, 1 \leq K \leq N$). The following $N-1$ lines represent the information of edges. The ($i+1$)-th line consists of two integers $u_i, v_i$ ($1 \leq u_i, v_i \leq N$ and $u_i \ne v_i $ for each $i$). Each $\\{u_i, v_i\\}$ is an edge of $T$. It's guaranteed that these edges form a tree.

Output

Print the maximum number of connected components with $K$ or more vertices in one line.

Examples

Input

2 1
1 2


Output

0


Input

7 3
1 2
2 3
3 4
4 5
5 6
6 7


Output

1


Input

12 2
1 2
2 3
3 4
4 5
3 6
6 7
7 8
8 9
6 10
10 11
11 12


Output

4


Input

3 1
1 2
2 3


Output

1


Input

3 2
1 2
2 3


Output

0


Input

9 3
1 2
1 3
1 4
4 5
4 6
4 7
7 8
7 9


Output

2

Solution (in CPP):

Solution:
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010

vector<int> G[SIZE];
int n,k;
int sum[SIZE], sumk[SIZE];
int dp[SIZE];
bool flag_sumk[SIZE];

int dfs1(int now, int back=-1){
  vector<int> vec1;
  vector<int> vec2;
  int sum_vec1 = 0;
  
  for(int i=0;i<G[now].size();i++){
    if(G[now][i] == back) continue;

    int res = dfs1(G[now][i], now);

    vec1.push_back(sumk[G[now][i]] >= 1);
    sum_vec1 += sumk[G[now][i]] >= 1;
    vec2.push_back(res);
    
    sum[now] += sum[G[now][i]];
    sumk[now] += sumk[G[now][i]] >= 1;
  }

  int maxSum = sum_vec1;
  
  for(int i=0;i<vec1.size();i++){
    maxSum = max(maxSum, sum_vec1 - vec1[i] + vec2[i]);
  }

  sum[now]++;

  if(sum[now] >= k && sumk[now] == 0){
    sumk[now] = 1;
    flag_sumk[now] = true;
    //maxSum = max(maxSum, 1);
  }

  dp[now] = maxSum;
  return maxSum;
}

int dfs2(int now, int back = -1, int prev_sumk = -INF){
  int ans = 0;
  int chisum = 0;
  vector<int> vec;
  int chisumk = 0;
  
  bool flag = false;
  for(int i=0;i<G[now].size();i++){
    if(G[now][i] == back) continue;
    chisum += sum[G[now][i]];
    chisumk += sumk[G[now][i]] >= 1;
    vec.push_back(dp[G[now][i]] - (sumk[G[now][i]] >= 1));
    flag |= sumk[G[now][i]] >= 1 && !flag_sumk[G[now][i]];
  }

  vec.push_back(0);
  vec.push_back(0);
  sort(vec.begin(), vec.end(), greater<int>());

  ans = max(ans, vec[0] + chisumk + prev_sumk);

  if(flag)
    ans = max(ans, vec[0] + vec[1] + chisumk + (n-1-chisum >= k));
  
  for(int i=0;i<G[now].size();i++){
    if(G[now][i] == back) continue;
    ans = max(ans, dfs2(G[now][i], now, sumk[now] - !!sumk[G[now][i]] + ((n-1-chisum) >= k) - flag_sumk[now]));
  }

  
  return ans;
}

int main(){
  int u,v;
  
  scanf("%d%d",&n,&k);

  for(int i=0;i<n-1;i++){
    scanf("%d%d",&u,&v);
    u--; v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }

  dfs1(0);

  cout << dfs2(0) << endl;
  
  return 0;
}