#include using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--) #define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i) #define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i) #define SORT(v, n) sort(v, v + n); #define REVERSE(v, n) reverse(v, v+n); #define vsort(v) sort(v.begin(), v.end()); #define all(v) v.begin(), v.end() #define mp(n, m) make_pair(n, m); #define cout(d) cout<; using vvi = vector; using vll = vector; using vvll = vector; using pii = pair; using pll = pair; using vs = vector; using vpll = vector>; using vtp = vector>; using vb = vector; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e9+10; const ll MOD = 1e9+7; const ll LINF = 1e18; vll G[2005]; ll n,k; ll cnts[2005]; void prep(ll v, ll p){ cnts[v]=1; for(auto nv: G[v]){ if(nv==p) continue; prep(nv,v); cnts[v]+=cnts[nv]; } } ll sz; vll dp; ll ans=0; void dfs2(vvll &child, ll sum, ll i){ if(i==sz){ if(sum==k) ans++; else if(sum!=0) dp.push_back(sum); return; } ll isz=child[i].size(); rep(j,isz+1){ if(j==isz) dfs2(child,sum,i+1); else dfs2(child,sum+child[i][j],i+1); } } vll dfs(ll v, ll p){ vvll child; for(auto &nv: G[v]){ if(nv==p) continue; auto c=dfs(nv,v); child.push_back(c); } sz=child.size(); dp.clear(); if(sz>0) dfs2(child,0,0); dp.push_back(cnts[v]); // cout<<"v="<>n>>k; rep(i,n-1){ ll a,b; cin>>a>>b; G[a].push_back(b); G[b].push_back(a); } prep(0,-1); dfs(0,-1); if(cnts[0]==k) ans++; cout<