#include <bits/stdc++.h>
using namespace std;
int n, m, d, x, y, start;
int distU[100002], distV[100002];
vector<vector<int> > adjL(100002);
bool vis[100002], isDamaged[100002];
int bfs(int st) {
  memset(vis, 0, sizeof vis);
  queue<pair<int, int> > Q;
  Q.push({st, 0});
  vis[st] = true;
  int maxDist = 0, vertex = st;
  while (!Q.empty()) {
    pair<int, int> curr = Q.front();
    Q.pop();
    for (int ch : adjL[curr.first])
      if (!vis[ch]) {
        vis[ch] = true;
        Q.push({ch, curr.second + 1});
        if (isDamaged[ch] && curr.second + 1 > maxDist)
          maxDist = curr.second + 1, vertex = ch;
      }
  }
  return vertex;
}
void fillDist(int st, int dist[]) {
  memset(vis, 0, sizeof vis);
  queue<pair<int, int> > Q;
  Q.push({st, 0});
  vis[st] = true;
  dist[st] = 0;
  while (!Q.empty()) {
    pair<int, int> curr = Q.front();
    Q.pop();
    for (int ch : adjL[curr.first])
      if (!vis[ch]) {
        vis[ch] = true;
        dist[ch] = curr.second + 1;
        Q.push({ch, curr.second + 1});
        ;
      }
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = (1); i <= (int)(m); ++i) scanf("%d", &x), isDamaged[x] = true;
  start = x;
  for (int i = (1); i <= (int)(n - 1); ++i) {
    scanf("%d %d", &x, &y);
    adjL[x].push_back(y);
    adjL[y].push_back(x);
  }
  int u = bfs(start);
  int v = bfs(u);
  fillDist(u, distU), fillDist(v, distV);
  int ans = 0;
  for (int i = (1); i <= (int)(n); ++i)
    if (distU[i] <= d and distV[i] <= d) ++ans;
  cout << ans;
}
