#include <bits/stdc++.h>
using namespace std;
int dist[100050][3], dis[100050];
struct edge {
  int v, nxt;
} e[200050];
int ecnt, head[100050];
void adde(int u, int v) {
  e[++ecnt].v = v;
  e[ecnt].nxt = head[u];
  head[u] = ecnt;
}
bool evil[100050];
void dfs(int u, int lst) {
  if (evil[u]) dist[u][1] = dist[u][2] = 0;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == lst) continue;
    dfs(v, u);
    if (dist[v][1] + 1 > dist[u][1]) {
      dist[u][2] = dist[u][1];
      dist[u][1] = dist[v][1] + 1;
    } else
      dist[u][2] = max(dist[v][1] + 1, dist[u][2]);
  }
  return;
}
void dfs2(int u, int lst) {
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == lst) continue;
    if (dist[u][1] == dist[v][1] + 1)
      dis[v] = max(dis[u] + 1, dist[u][2] + 1);
    else
      dis[v] = max(dis[u] + 1, dist[u][1] + 1);
    dfs2(v, u);
  }
  return;
}
int d;
int main() {
  memset(dist, 128, sizeof(dist));
  memset(dis, 128, sizeof(dis));
  int n, m;
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 1; i <= m; ++i) {
    int p;
    scanf("%d", &p);
    evil[p] = 1;
  }
  for (int i = 1; i < n; ++i) {
    int fr, t;
    scanf("%d%d", &fr, &t);
    adde(fr, t);
    adde(t, fr);
  }
  dfs(1, 0);
  dfs2(1, 0);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == 1) {
      if (dist[i][1] <= d && dist[i][2] <= d) ans++;
    } else if (dis[i] <= d && dist[i][1] <= d)
      ans++;
  }
  printf("%d\n", ans);
}
