#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int INF = 1000000000;
int n, m, d, fa[N], dist[N], dist2[N];
bool p[N], used[N];
vector<int> adj[N], child[N];
vector<int> pmx[N], smx[N];
void make(int i, int parent) {
  used[i] = true;
  fa[i] = parent;
  for (int j = 0; j < adj[i].size(); j++) {
    if (adj[i][j] != parent) {
      make(adj[i][j], i);
      child[i].push_back(adj[i][j]);
    }
  }
  if (child[i].size()) {
    pmx[i].resize(child[i].size());
    smx[i].resize(child[i].size());
  }
}
int dfs(int i) {
  dist[i] = -INF;
  for (int j = 0; j < child[i].size(); j++) {
    dist[i] = max(dist[i], dfs(child[i][j]));
  }
  if (dist[i] != -INF)
    dist[i]++;
  else if (p[i])
    dist[i] = 0;
  if (p[i] && !child[i].size()) dist[i] = 0;
  return dist[i];
}
void dfs2(int i, int mx) {
  dist2[i] = mx;
  if (!child[i].size()) return;
  int cur;
  pmx[i][0] = dist[child[i][0]];
  smx[i][child[i].size() - 1] = dist[child[i].back()];
  for (int j = 1; j < pmx[i].size(); j++)
    pmx[i][j] = max(pmx[i][j - 1], dist[child[i][j]]);
  for (int j = smx[i].size() - 2; j > -1; j--)
    smx[i][j] = max(smx[i][j + 1], dist[child[i][j]]);
  for (int j = 0; j < child[i].size(); j++) {
    cur = max(j > 0 ? pmx[i][j - 1] : -INF,
              j < child[i].size() - 1 ? smx[i][j + 1] : -INF);
    cur += 2;
    cur = max(cur, mx + 1);
    if (p[i]) cur = max(cur, 1);
    if (p[child[i][j]]) cur = max(cur, 0);
    dfs2(child[i][j], cur);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  memset(p, false, sizeof(p));
  for (int i = 0; i < m; i++) {
    int u;
    scanf("%d", &u);
    u--;
    p[u] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  make(0, -1);
  dfs(0);
  dfs2(0, -INF);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (dist[i] <= d && dist2[i] <= d) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
