A tree is a connected graph that doesn't contain any cycles.

The distance between two vertices of a tree is the length (in edges) of the shortest path between these vertices.

You are given a tree with n vertices and a positive number k. Find the number of distinct pairs of the vertices which have a distance of exactly k between them. Note that pairs (v, u) and (u, v) are considered to be the same pair.

Input

The first line contains two integers n and k (1 ≤ n ≤ 50000, 1 ≤ k ≤ 500) — the number of vertices and the required distance between the vertices.

Next n - 1 lines describe the edges as "ai bi" (without the quotes) (1 ≤ ai, bi ≤ n, ai ≠ bi), where ai and bi are the vertices connected by the i-th edge. All given edges are different.

Output

Print a single integer — the number of distinct pairs of the tree's vertices which have a distance of exactly k between them.

Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples

Input

5 2
1 2
2 3
3 4
2 5


Output

4


Input

5 3
1 2
2 3
3 4
4 5


Output

2

Note

In the first sample the pairs of vertexes at distance 2 from each other are (1, 3), (1, 5), (3, 5) and (2, 4).
import javax.xml.bind.SchemaOutputResolver;
import java.io.*;
import java.util.Vector;
 
public class SOLVE {
 
    static public final int maxn = (int)5e4 + 5;
 
    static public int n, k, cent;
    static public int[] size = new int[maxn];
    static public int[] used = new int[maxn];
    static public Vector<Integer>[] g = new Vector[maxn];
    static public long answ = 0L;
 
    static public void dfs(int v, int p) {
        size[v] = 1;
        for (int i = 0; i < g[v].size(); i++) {
            int u = g[v].get(i);
            if (u == p || used[u] == 1) continue;
            dfs(u, v);
            size[v] += size[u];
        }
    }
 
    static public void getCent(int v, int p, int cnt){
        int ok = 0;
        for (int i = 0; i < g[v].size(); i++) {
            int u = g[v].get(i);
            if(used[u] == 1 || u == p)continue;
            if(size[u] - 1 >= cnt){
                ok = 1;
                getCent(u, v, cnt);
                break;
            }
        }
        if(ok == 0)
            cent = v;
    }
 
    static public void dfs(int v, int p, Vector<Integer> ans, int l){
        if (l <= k){
            ans.add(l);
        }else return;
        for (int i = 0; i < g[v].size(); i++) {
            int u = g[v].get(i);
            if (used[u] != 1 && u != p){
                dfs(u, v, ans, l + 1);
            }
        }
    }
 
    static public void centroidDecomposition(int v){
        int[] count = new int[501];
        dfs(v, - 1);
        cent = v;
        int node = v;
        getCent(v, -1, ((size[v] - 1) / 2));
        node = cent;
 
        Vector<Integer> ans = new Vector<>();
 
        for (int i = 0; i < g[node].size(); i++) {
            int u = g[node].get(i);
            if (used[u] == 1) continue;
            ans.clear();
            dfs(u, node, ans, 1);
 
            for (int j = 0; j < ans.size(); j++) {
                if (k == ans.get(j)) answ++;
                else answ += (long)count[k - ans.get(j)];
            }
 
            for (int j = 0; j < ans.size(); j++) {
                count[ans.get(j)]++;
            }
        }
 
        used[node] = 1;
 
        for (int i = 0; i < g[node].size(); i++) {
            int u = g[node].get(i);
            if (used[u] == 1) continue;
            centroidDecomposition(u);
        }
    }
 
    public static void main(String[] args) throws IOException {
        BufferedReader bis = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] s = bis.readLine().split("\\s");
        n = Integer.parseInt(s[0]);
        k = Integer.parseInt(s[1]);
        for (int i = 0; i < n - 1; i++) {
            s = bis.readLine().split("\\s");
            int x = Integer.parseInt(s[0]), y = Integer.parseInt(s[1]);
            if (g[x] == null) g[x] = new Vector<>();
            if (g[y] == null) g[y] = new Vector<>();
            g[x].add(y); g[y].add(x);
        }
        centroidDecomposition(1);
        out.write(Long.toString(answ) + '\n');
        out.flush();
    }
}