#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;
int x, y, z;
int ans;
bool flag[100010];
vector<int> graph[100010];
int dist[3][100010];
void DFS(int p, int x, int id, int d) {
  dist[id][x] = d;
  for (int i = 0; i < graph[x].size(); i++) {
    int y = graph[x][i];
    if (y != p) DFS(x, y, id, d + 1);
  }
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin >> N >> M >> D;
  for (int i = 0; i < M; i++) {
    cin >> x;
    flag[x - 1] = 1;
  }
  for (int i = 0; i < N - 1; i++) {
    int a, b;
    cin >> a >> b;
    graph[--a].push_back(--b);
    graph[b].push_back(a);
  }
  for (x = 0; x < N; x++)
    if (flag[x]) break;
  DFS(-1, x, 0, 0);
  y = x;
  for (int i = 0; i < N; i++)
    if (flag[i] && dist[0][i] > dist[0][y]) y = i;
  DFS(-1, y, 1, 0);
  z = y;
  for (int i = 0; i < N; i++)
    if (flag[i] && dist[1][i] > dist[1][z]) z = i;
  DFS(-1, z, 2, 0);
  for (int i = 0; i < N; i++)
    if (dist[1][i] <= D && dist[2][i] <= D) ans++;
  cout << ans;
  return 0;
}
