#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<int> adj[100005];
bool marcat[100005], viz[100005];
int dsus[100005], djos[100005];
int max1[100005], max2[100005];
void dfs1(int nod) {
  viz[nod] = true;
  if (marcat[nod]) djos[nod] = 0;
  for (vector<int>::iterator it = adj[nod].begin(); it != adj[nod].end();
       it++) {
    int fiu = *it;
    if (!viz[fiu]) {
      dfs1(fiu);
      djos[nod] = max(djos[nod], djos[fiu] + 1);
      if (djos[fiu] > max1[nod]) {
        max2[nod] = max1[nod];
        max1[nod] = djos[fiu];
      } else if (djos[fiu] > max2[nod])
        max2[nod] = djos[fiu];
    }
  }
}
void dfs2(int nod, int tata) {
  viz[nod] = true;
  if (marcat[nod]) dsus[nod] = 0;
  dsus[nod] = max(dsus[nod], dsus[tata] + 1);
  if (djos[nod] == max1[tata])
    dsus[nod] = max(dsus[nod], 2 + max2[tata]);
  else
    dsus[nod] = max(dsus[nod], 2 + max1[tata]);
  for (vector<int>::iterator it = adj[nod].begin(); it != adj[nod].end();
       it++) {
    int fiu = *it;
    if (!viz[fiu]) dfs2(fiu, nod);
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 1; i <= m; i++) {
    int nod;
    cin >> nod;
    marcat[nod] = true;
  }
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 0; i <= n; i++) {
    djos[i] = max1[i] = max2[i] = -1e9;
  }
  dfs1(1);
  for (int i = 0; i <= n; i++) {
    viz[i] = false;
    dsus[i] = -1e9;
  }
  dfs2(1, 0);
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (dsus[i] <= d && djos[i] <= d) cnt++;
  cout << cnt;
  return 0;
}
