#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m, d, p[maxn], pos, vis[maxn], dis1[maxn], dis[maxn];
vector<int> g[maxn];
void dfs1(int x) {
  vis[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int v = g[x][i];
    if (vis[v] == 0) {
      vis[v] = 1;
      dis1[v] = dis1[x] + 1;
      dfs1(v);
    }
  }
}
void dfs(int x) {
  vis[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int v = g[x][i];
    if (vis[v] == 0) {
      vis[v] = 1;
      dis[v] = dis[x] + 1;
      dfs(v);
    }
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> m >> d;
  for (int i = 1; i <= m; i++) {
    int tmp;
    cin >> tmp;
    p[tmp] = 1;
    if (i == 1) pos = tmp;
  }
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v), g[v].push_back(u);
  }
  dfs1(pos);
  int ma = 0;
  for (int i = 1; i <= n; i++) {
    if (dis1[i] > ma && p[i] == 1) {
      pos = i;
      ma = dis1[i];
    }
  }
  memset(vis, 0, sizeof vis);
  dfs(pos);
  int ans = 0;
  ma = 0;
  for (int i = 1; i <= n; i++) {
    if (dis[i] > ma && p[i] == 1) {
      pos = i;
      ma = dis[i];
    }
  }
  memset(vis, 0, sizeof vis);
  memset(dis1, 0, sizeof dis1);
  dfs1(pos);
  for (int i = 1; i <= n; i++) {
    if (dis1[i] <= d && dis[i] <= d) ans++;
  }
  cout << ans << endl;
}
