#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 100;
const long long INF = -1e17;
vector<long long> e[N];
long long m, n, d, max1[N], max2[N], idmax1[N], idmax2[N], dpD[N], dpU[N];
bool p[N], mark[N];
long long dfs1(long long v, long long par) {
  if (p[v]) {
    dpD[v] = 0;
    max1[v] = 0;
    idmax1[v] = v;
  }
  for (long long i = 0; i < e[v].size(); i++) {
    long long nv = e[v][i];
    if (par == nv) continue;
    long long New = dfs1(nv, v) + 1;
    dpD[v] = max(New, dpD[v]);
    if (New > max1[v]) {
      max2[v] = max1[v], idmax2[v] = idmax1[v];
      max1[v] = New, idmax1[v] = nv;
    } else if (New > max2[v])
      max2[v] = New, idmax2[v] = nv;
  }
  return dpD[v];
}
void dfs2(long long v, long long par) {
  if (p[par]) dpU[v] = 1;
  if (par != -1) {
    if (v == idmax1[par])
      dpU[v] = max(dpU[par], max2[par]) + 1;
    else
      dpU[v] = max(dpU[par], max1[par]) + 1;
  }
  for (long long i = 0; i < e[v].size(); i++) {
    long long nv = e[v][i];
    if (nv == par) continue;
    dfs2(nv, v);
  }
}
int main(int argc, const char* argv[]) {
  for (long long i = 0; i < N; i++)
    dpD[i] = INF, dpU[i] = INF, max2[i] = INF, max1[i] = INF, idmax1[i] = INF,
    idmax2[i] = INF;
  cin >> n >> m >> d;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    p[x] = 1;
  }
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs1(1, -1);
  dfs2(1, -1);
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    if (dpD[i] <= d && dpU[i] <= d) ans++;
  cout << ans;
  return 0;
}
