#include <bits/stdc++.h>
using namespace std;
vector<int> L[100005];
int vis[100005];
bool P[100005];
int n;
int BFS(int source, int level) {
  deque<int> Q;
  Q.push_back(source);
  vector<int> D(n + 1, -1);
  D[source] = 0;
  while (!Q.empty()) {
    int pd = Q.front();
    Q.pop_front();
    if (D[pd] <= level) vis[pd] += 1;
    for (int i = 0; i < L[pd].size(); i++) {
      int to = L[pd][i];
      if (D[to] == -1) {
        Q.push_back(to);
        D[to] = D[pd] + 1;
      }
    }
  }
  int ans = -1, maxi = -1;
  for (int i = 0; i < n; i++)
    if (maxi < D[i] && P[i]) ans = i, maxi = D[i];
  return ans;
}
int node;
int solved(int d) {
  int v1 = BFS(node, (1 << 28));
  if (v1 == -1) return 0;
  int v2 = BFS(v1, (1 << 28));
  memset(vis, 0, sizeof vis);
  int ans = 0;
  BFS(v1, d);
  BFS(v2, d);
  for (int i = 0; i < n; i++)
    if (vis[i] > 1) ans++;
  return ans;
}
int main() {
  int m, d, x, y;
  while (scanf("%d%d%d", &n, &m, &d) == 3) {
    for (int i = 0; i < m; i++) {
      scanf("%d", &x);
      x--;
      node = x;
      P[x] = 1;
    }
    for (int i = 0; i < n - 1; i++) {
      scanf("%d%d", &x, &y);
      x--;
      y--;
      L[x].push_back(y);
      L[y].push_back(x);
    }
    printf("%d\n", solved(d));
  }
}
