#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, d;
int h[N];
vector<int> g[N];
int vis[N], dis[N];
int bfs(int s, int f) {
  queue<int> Q;
  Q.push(s);
  vis[s]++;
  dis[s] = 0;
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    for (int i = 0; i < (int)(g[u]).size(); i++) {
      int v = g[u][i];
      if (vis[v] == f) {
        vis[v]++;
        Q.push(v);
        dis[v] = dis[u] + 1;
      }
    }
  }
  int Max = -1, ans;
  for (int i = 1; i <= n; i++) {
    if (h[i]) {
      if (Max < dis[i]) {
        Max = dis[i];
        ans = i;
      }
    }
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 1; i <= n; i++) h[i] = 0, g[i].clear(), vis[i] = 0;
  while (m--) {
    int x;
    scanf("%d", &x);
    h[x] = 1;
  }
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int s = bfs(1, 0);
  int t = bfs(s, 1);
  bfs(s, 2);
  for (int i = 1; i <= n; i++) h[i] = 0;
  for (int i = 1; i <= n; i++)
    if (dis[i] <= d) h[i]++;
  bfs(t, 3);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (dis[i] <= d && h[i]) ans++;
  printf("%d\n", ans);
  return 0;
}
