#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 5;
const long long int inf = 1e9 + 7;
long long int in[N], out[N], mark[N];
vector<long long int> g[N];
void dfs1(long long int u, long long int p) {
  if (!mark[u]) {
    in[u] = -inf;
  } else {
    in[u] = 0;
  }
  for (long long int v : g[u]) {
    if (v == p) continue;
    dfs1(v, u);
    in[u] = max(in[u], 1 + in[v]);
  }
}
void dfs2(long long int u, long long int p) {
  long long int max1 = -inf, max2 = -inf;
  for (long long int v : g[u]) {
    if (v == p) continue;
    if (in[v] >= max1) {
      max2 = max1;
      max1 = in[v];
    } else if (in[v] > max2) {
      max2 = in[v];
    }
  }
  long long int use;
  for (long long int v : g[u]) {
    if (v == p) continue;
    use = max1;
    if (in[v] == max1) use = max2;
    out[v] = max(2 + use, 1 + out[u]);
    if (mark[v] and out[v] < 0) out[v] = 0;
    dfs2(v, u);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m, d;
  cin >> n >> m >> d;
  for (long long int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    mark[x] = 1;
  }
  for (long long int i = 0; i < n - 1; i++) {
    long long int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs1(1, 0);
  out[1] = -inf;
  if (mark[1]) out[1] = 0;
  dfs2(1, 0);
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    if (in[i] <= d and out[i] <= d) ans++;
  }
  cout << ans << endl;
  return 0;
}
