#include <bits/stdc++.h>
using namespace std;
int head[100050], to[100050 << 1], nxt[100050 << 1], dis1[100050], dis2[100050],
    cnt, n, m, d, is[100050], root, dis3[100050];
inline void add(int u, int v) {
  to[++cnt] = v;
  nxt[cnt] = head[u];
  head[u] = cnt;
}
void dfs1(int x, int y) {
  int i;
  if (dis1[x] > dis1[root] && is[x]) root = x;
  for (i = head[x]; i; i = nxt[i]) {
    if (to[i] != y) {
      dis1[to[i]] = dis1[x] + 1;
      dfs1(to[i], x);
    }
  }
}
void dfs2(int x, int y) {
  int i;
  if (dis2[x] > dis2[root] && is[x]) root = x;
  for (i = head[x]; i; i = nxt[i]) {
    if (to[i] != y) {
      dis2[to[i]] = dis2[x] + 1;
      dfs2(to[i], x);
    }
  }
}
void dfs3(int x, int y) {
  int i;
  for (i = head[x]; i; i = nxt[i]) {
    if (to[i] != y) {
      dis3[to[i]] = dis3[x] + 1;
      dfs3(to[i], x);
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  int i, x, y;
  for (i = 1; i <= m; i++) {
    scanf("%d", &x);
    is[x] = 1;
  }
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  for (i = 1; i <= n; i++)
    if (is[i]) {
      dfs1(root = i, 0);
      break;
    }
  dfs2(root, 0);
  dfs3(root, 0);
  int ans = 0;
  for (i = 1; i <= n; i++)
    if (dis3[i] <= d && dis2[i] <= d) ans++;
  printf("%d\n", ans);
}
