#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int Read() {
  char c;
  c = getchar();
  int tsqua = 0;
  while (c != ' ' && c != '\n') {
    tsqua = (((tsqua << 1) << 1) << 1) + (tsqua << 1) + (int)(c - '0');
    c = getchar();
  }
  return tsqua;
}
vector<int> E[100010];
int Effects[100010];
int d1[100010], d2[100010], d3[100010];
int p1, p2, p3;
void DFS(int x, int pre, int* d) {
  d[x] = d[pre] + 1;
  for (int i = 0; i < E[x].size(); i++)
    if (E[x][i] != pre) DFS(E[x][i], x, d);
}
int n, m, d;
int ans;
int main(int argc, char const* argv[]) {
  ios::sync_with_stdio(false);
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    int p;
    cin >> p;
    Effects[p] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    E[x].push_back(y);
    E[y].push_back(x);
  }
  DFS(1, 0, d1);
  for (int i = 1; i <= n; i++)
    if (Effects[i] && (d1[i] > d1[p1])) p1 = i;
  DFS(p1, 0, d2);
  for (int i = 1; i <= n; i++)
    if (Effects[i] && (d2[i] > d2[p2])) p2 = i;
  DFS(p2, 0, d3);
  for (int i = 1; i <= n; i++)
    if ((d2[i] <= d + 1) && (d3[i] <= d + 1)) ans++;
  cout << ans;
  return 0;
}
