#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 20;
int N, M, D;
set<int> E[MAX_N];
bool aff[MAX_N];
int down[MAX_N];
int solve_down(int u) {
  down[u] = -1e9;
  if (aff[u]) down[u] = 0;
  for (int v : E[u]) {
    E[v].erase(u);
    down[u] = max(down[u], solve_down(v) + 1);
  }
  return down[u];
}
int up[MAX_N], save[MAX_N];
int solve_up(int u, int d) {
  if (aff[u] && d < 0) d = 0;
  up[u] = d;
  for (int v : E[u]) save[v] = d + 1;
  int mx = -1e9;
  for (auto it = E[u].begin(); it != E[u].end(); ++it) {
    int v = *it;
    save[v] = max(save[v], mx);
    mx = max(mx, down[v] + 2);
  }
  mx = -1e9;
  for (auto it = E[u].rbegin(); it != E[u].rend(); ++it) {
    int v = *it;
    save[v] = max(save[v], mx);
    mx = max(mx, down[v] + 2);
  }
  for (int v : E[u]) solve_up(v, save[v]);
  return up[u];
}
int main() {
  cin >> N >> M >> D;
  int u, v;
  for (int i = 0; i < M; ++i) {
    cin >> u;
    --u;
    aff[u] = true;
  }
  for (int i = 0; i < N - 1; ++i) {
    cin >> u >> v;
    --u, --v;
    E[u].insert(v);
    E[v].insert(u);
  }
  solve_down(0);
  solve_up(0, -1e9);
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    if (down[i] <= D && up[i] <= D) ++ans;
  }
  cout << ans << "\n";
  return 0;
}
