#include <bits/stdc++.h>
using namespace std;
int n, m, d, w, Max, ans, x, y, cnt, w1, w2, nxt[200007], lst[200007],
    edge[100007], deep[100007][2];
bool b[100007];
void build(int k, int fa, int q) {
  for (int i = edge[k]; i; i = lst[i]) {
    int v = nxt[i];
    if (v == fa) continue;
    deep[v][q] = deep[k][q] + 1;
    if (b[v] && Max < deep[v][q]) {
      Max = deep[v][q];
      w = v;
    }
    build(v, k, q);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    b[x] = true;
  }
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    nxt[++cnt] = x;
    lst[cnt] = edge[y];
    edge[y] = cnt;
    nxt[++cnt] = y;
    lst[cnt] = edge[x];
    edge[x] = cnt;
  }
  build(1, -1, 0);
  w1 = w;
  memset(deep, 0, sizeof(deep));
  w = 0;
  Max = 0;
  build(w1, -1, 0);
  w2 = w;
  w = 0;
  Max = 0;
  build(w2, -1, 1);
  for (int i = 1; i <= n; i++)
    if (deep[i][0] <= d && deep[i][1] <= d) ans++;
  printf("%d\n", ans);
  return 0;
}
