#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int n, m, d, D[100010], Q[100010], D2[100010];
bool chk[100010];
vector<int> E[100010];
int BFS(int a) {
  int h = 0, t = 0, x, M;
  for (int i = 1; i <= n; i++) D[i] = -1;
  Q[++t] = a;
  D[a] = 0;
  while (h < t) {
    x = Q[++h];
    for (int i = 0; i < E[x].size(); i++) {
      if (D[E[x][i]] == -1) {
        D[E[x][i]] = D[x] + 1;
        Q[++t] = E[x][i];
      }
    }
  }
  M = -1;
  for (int i = 1; i <= n; i++)
    if (chk[i] && M < D[i]) M = D[i], x = i;
  return x;
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  int a, b, c, ans = 0;
  cin >> n >> m >> d;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    chk[a] = 1;
  }
  for (int i = 1; i < n; i++) {
    cin >> b >> c;
    E[b].push_back(c);
    E[c].push_back(b);
  }
  b = BFS(a);
  a = BFS(b);
  for (int i = 1; i <= n; i++) D2[i] = D[i];
  b = BFS(a);
  for (int i = 1; i <= n; i++)
    if (D[i] <= d && D2[i] <= d) ans++;
  cout << ans;
  return 0;
}
