#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 22, INF = 1e9 + 22;
int n, m, d;
int dpd[N], dpu[N];
vector<int> G[N];
void dfsd(int v, int p = -1) {
  for (int i = 0; i < (G[v].size()); i++) {
    int u = G[v][i];
    if (u == p) continue;
    dfsd(u, v);
    dpd[v] = max(dpd[v], dpd[u] + 1);
  }
}
void dfsu(int v, int p = -1) {
  vector<int> vec;
  for (int i = 0; i < (G[v].size()); i++) {
    int u = G[v][i];
    if (u == p) continue;
    vec.push_back(dpd[u]);
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < (G[v].size()); i++) {
    int u = G[v][i];
    if (u == p) continue;
    dpu[u] = max(dpu[v] + 1, dpu[u]);
    if (vec.size() - 2 >= 0 && vec.back() == dpd[u])
      dpu[u] = max(dpu[u], vec[vec.size() - 2] + 2);
    else if (vec.size() != 1)
      dpu[u] = max(dpu[u], vec.back() + 2);
  }
  for (int i = 0; i < (G[v].size()); i++) {
    int u = G[v][i];
    if (u == p) continue;
    dfsu(u, v);
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int x, y, ans = 0;
  cin >> n >> m >> d;
  fill(dpd, dpd + n, -INF), fill(dpu, dpu + n, -INF);
  for (int i = 0; i < (m); i++) cin >> x, x--, dpd[x] = 0, dpu[x] = 0;
  for (int i = 0; i < (n - 1); i++) {
    cin >> x >> y;
    x--, y--;
    G[x].push_back(y), G[y].push_back(x);
  }
  dfsd(0);
  dfsu(0);
  for (int i = 0; i < (n); i++) ans += (dpd[i] <= d && dpu[i] <= d);
  cout << ans;
  return 0;
}
