#include <bits/stdc++.h>
using namespace std;
const long long nax = 1e5 + 100;
vector<long long> g[nax];
long long dis[nax][2], n, m, d, vis[nax];
void dfs(long long s, long long p, long long dd) {
  for (auto it : g[s])
    if (it != p) {
      dis[it][dd] = dis[s][dd] + 1;
      dfs(it, s, dd);
    }
}
int32_t main() {
  cin >> n >> m >> d;
  for (long long i = 1; i <= m; i++) {
    long long x;
    cin >> x;
    vis[x] = 1;
  }
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0, 0);
  long long val = 1;
  for (long long i = 1; i <= n; i++)
    if (vis[i] and dis[i][0] > dis[val][0]) val = i;
  dis[val][0] = 0;
  dfs(val, 0, 0);
  for (long long i = 1; i <= n; i++)
    if (vis[i] and dis[i][0] > dis[val][0]) val = i;
  dfs(val, 0, 1);
  long long res = 0;
  for (long long i = 1; i <= n; i++)
    if (max(dis[i][0], dis[i][1]) <= d) ++res;
  cout << res;
  return 0;
}
