#include <bits/stdc++.h>
const static int INF = 0x3f3f3f3f;
static inline void setio(void);
int n, m, d;
std::vector<int> gr[100001];
char bad[100001], have[100001], in_dia[100001];
int dist[100001], pred[100001];
void bfs(const int& start) {
  memset(dist, 0x3f, sizeof(dist));
  memset(pred, 0xff, sizeof(pred));
  dist[start] = 0;
  std::queue<int> order;
  order.push(start);
  while (!order.empty()) {
    int cur = order.front();
    order.pop();
    for (const auto& nei : gr[cur]) {
      if (dist[nei] > 1 + dist[cur]) {
        dist[nei] = 1 + dist[cur];
        pred[nei] = cur;
        order.push(nei);
      }
    }
  }
}
void dfs(const int& cur, const int& par, const int& left) {
  if (left < 0) return;
  have[cur] = true;
  for (const auto& nei : gr[cur])
    if (par != nei && !in_dia[nei]) dfs(nei, cur, left - 1);
}
int main(void) {
  setio();
  int big_bad = -1;
  std::cin >> n >> m >> d;
  for (int i = 0, p; i < m; ++i) {
    std::cin >> p;
    bad[p - 1] = true;
    big_bad = std::max(big_bad, p - 1);
  }
  for (int i = 1, a, b; i < n; ++i) {
    std::cin >> a >> b;
    --a;
    --b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  bfs(big_bad);
  for (int i = 0; i < n; ++i)
    if (bad[i] && dist[i] > dist[big_bad]) big_bad = i;
  const int start = big_bad;
  bfs(big_bad);
  for (int i = 0; i < n; ++i)
    if (bad[i] && dist[i] > dist[big_bad]) big_bad = i;
  for (int cur = big_bad; (in_dia[cur] = true) && cur != start; cur = pred[cur])
    ;
  for (int cur = big_bad, inv = 0;; cur = pred[cur], ++inv) {
    dfs(cur, -1, d - std::max(dist[cur], inv));
    if (cur == start) break;
  }
  memset(dist, 0x3f, sizeof(dist));
  std::queue<int> order;
  for (int i = 0; i < n; ++i)
    if (have[i]) {
      dist[i] = 0;
      order.push(i);
    }
  while (!order.empty()) {
    int cur = order.front();
    order.pop();
    for (const auto& nei : gr[cur]) {
      if (dist[nei] > 1 + dist[cur]) {
        dist[nei] = 1 + dist[cur];
        order.push(nei);
      }
    }
  }
  bool good = true;
  int have_cnt = 0;
  for (int i = 0; i < n; ++i) {
    good = good && (!bad[i] || dist[i] <= d);
    have_cnt += have[i];
  }
  if (!good) have_cnt = 0;
  std::cout << have_cnt << "\n";
  std::cerr << static_cast<double>(clock()) / CLOCKS_PER_SEC << "\n";
  return 0;
}
static inline void setio(void) {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.precision(10);
  std::cout << std::fixed;
}
