#include <bits/stdc++.h>
using namespace std;
const int inf = 1010101010;
int i, n, m, d, evil[101010], up[101010], down[101010], __prev__[101010],
    mx1[101010], mx2[101010];
vector<int> g[101010];
int dfs1(int x, int pr) {
  int ans = -inf;
  if (evil[x]) ans = 0;
  for (int t = 0; t < g[x].size(); t++)
    if (g[x][t] != pr) {
      int dis = dfs1(g[x][t], x);
      ans = max(ans, dis);
      if (dis > mx1[x])
        mx2[x] = mx1[x], mx1[x] = dis;
      else if (dis > mx2[x])
        mx2[x] = dis;
    }
  down[x] = ans;
  return ans + 1;
}
void dfs2(int x, int pr) {
  __prev__[x] = pr;
  int ans = -inf, t;
  if (evil[x]) ans = 0;
  if (pr != -1) {
    if (mx1[pr] != down[x] + 1)
      ans = max(ans, mx1[pr] + 1);
    else
      ans = ans = max(ans, mx2[pr] + 1);
    ans = max(ans, up[pr] + 1);
  }
  up[x] = ans;
  for (t = 0; t < g[x].size(); t++)
    if (g[x][t] != pr) dfs2(g[x][t], x);
  return;
}
int main() {
  scanf("%d %d %d", &n, &m, &d);
  fill(up, up + n + 1, -inf);
  fill(down, down + n + 1, -inf);
  fill(mx1, mx1 + n + 1, -inf);
  fill(mx2, mx2 + n + 1, -inf);
  for (i = 0; i < m; i++) {
    int b;
    scanf("%d", &b);
    evil[b] = 1;
  }
  for (i = 1; i < n; i++) {
    int v1, v2;
    scanf("%d %d", &v1, &v2);
    g[v1].push_back(v2);
    g[v2].push_back(v1);
  }
  for (i = 1; i <= n; i++)
    if (g[i].size() == 1) break;
  dfs1(i, -1);
  dfs2(i, -1);
  int ans = 0;
  for (i = 1; i <= n; i++)
    if (max(down[i], up[i]) <= d) ++ans;
  printf("%d\n", ans);
  return 0;
}
