#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
vector<int> G[MAXN];
int n, m, d;
int down[MAXN], up[MAXN];
int L[MAXN], R[MAXN];
int c[MAXN];
int ans;
void dfs1(int u, int f) {
  down[u] = 0;
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (v == f) continue;
    dfs1(v, u);
    down[u] = max(down[v], down[u]);
  }
  if (down[u])
    down[u]++;
  else
    down[u] = c[u];
}
void dfs2(int u, int f) {
  if (max(down[u], up[u]) <= d) {
    ans++;
  }
  int n = G[u].size();
  L[0] = 0;
  if (n) R[n - 1] = 0;
  for (int i = 0; i < n - 1; ++i) {
    int v = G[u][i];
    if (v != f)
      L[i + 1] = max(L[i], down[v]);
    else
      L[i + 1] = L[i];
  }
  for (int i = n - 1; i > 0; --i) {
    int v = G[u][i];
    if (v != f)
      R[i - 1] = max(R[i], down[v]);
    else
      R[i - 1] = R[i];
  }
  for (int i = 0; i < n; ++i) {
    int v = G[u][i];
    if (v == f) continue;
    if (up[u])
      up[v] = up[u] + 1;
    else
      up[v] = c[v];
    if (R[i]) up[v] = max(up[v], R[i] + 2);
    if (L[i]) up[v] = max(up[v], L[i] + 2);
  }
  for (int i = 0; i < n; ++i) {
    int v = G[u][i];
    if (v == f) continue;
    dfs2(v, u);
  }
}
void solve() {
  int u, v;
  ans = 0;
  ++d;
  for (int i = 1; i <= n; ++i) {
    c[i] = 0;
    G[i].clear();
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &u);
    c[u] = 1;
  }
  up[1] = c[1];
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs1(1, 1);
  dfs2(1, 1);
  printf("%d\n", ans);
}
int main() {
  while (~scanf("%d%d%d", &n, &m, &d)) solve();
  return 0;
}
