#include <bits/stdc++.h>
struct sl {
  int last, to;
} a[200001];
int head[100001], down[100001][2], up[100001], i, j, n, m, k, l, o, d, x, y,
    ans;
bool p[100001];
void get(int x, int y) {
  a[++k].last = head[x];
  a[k].to = y;
  head[x] = k;
}
void dfs1(int k, int fa) {
  int i;
  if (p[k]) down[k][0] = up[k] = 0;
  for (i = head[k]; i != 0; i = a[i].last)
    if (a[i].to != fa) {
      int u = a[i].to;
      dfs1(u, k);
      if (down[u][0] + 1 > down[k][0]) {
        down[k][1] = down[k][0];
        down[k][0] = down[u][0] + 1;
      } else
        down[k][1] = std::max(down[k][1], down[u][0] + 1);
    }
}
void dfs2(int k, int fa) {
  int i;
  for (i = head[k]; i != 0; i = a[i].last)
    if (a[i].to != fa) {
      int u = a[i].to;
      if (down[k][0] == down[u][0] + 1)
        up[u] = std::max(up[k] + 1, down[k][1] + 1);
      else
        up[u] = std::max(up[k] + 1, down[k][0] + 1);
      dfs2(u, k);
    }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  memset(down, -0x7f, sizeof down);
  memset(up, -0x7f, sizeof up);
  for (i = 1; i <= m; i++) {
    scanf("%d", &o);
    p[o] = true;
  }
  for (i = 1; i <= n - 1; i++) {
    scanf("%d%d", &x, &y);
    get(x, y);
    get(y, x);
  }
  dfs1(1, n + 1);
  dfs2(1, n + 1);
  for (i = 1; i <= n; i++)
    if (down[i][0] <= d && up[i] <= d) ans++;
  printf("%d", ans);
}
