#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long inf = 1e18;
vector<long long> adj[N];
bool evil[N];
long long maxDown[N];
long long maxUp[N];
void dfs1(long long node, long long par) {
  for (long long i = 0; i < (long long)adj[node].size(); ++i) {
    const long long child = adj[node][i];
    if (child == par) {
      adj[node].erase(adj[node].begin() + i);
      break;
    }
  }
  maxDown[node] = -inf;
  if (evil[node]) {
    maxDown[node] = 0;
  }
  for (long long child : adj[node]) {
    dfs1(child, node);
    maxDown[node] = max(maxDown[node], 1 + maxDown[child]);
  }
}
void dfs2(long long node, long long par) {
  vector<long long> suffix(adj[node].size() + 1, -inf);
  for (long long i = (long long)adj[node].size() - 1; i >= 0; --i) {
    const long long child = adj[node][i];
    suffix[i] = max(suffix[i + 1], maxDown[child]);
  }
  long long prefix = -inf;
  for (long long i = 0; i < (long long)adj[node].size(); ++i) {
    const long long child = adj[node][i];
    long long &curr = maxUp[child];
    curr = -inf;
    if (evil[child]) {
      curr = 0;
    }
    curr = max(curr, maxUp[node] + 1);
    curr = max({curr, 2 + prefix, 2 + suffix[i + 1]});
    prefix = max(prefix, maxDown[child]);
    dfs2(child, node);
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, d;
  cin >> n >> m >> d;
  while (m--) {
    long long node;
    cin >> node;
    evil[node] = true;
  }
  for (long long i = 1; i < n; ++i) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs1(1, 1);
  maxUp[1] = -inf;
  if (evil[1]) maxUp[1] = 0;
  dfs2(1, 1);
  long long cnt = 0;
  for (long long i = 1; i <= n; ++i) {
    if (maxDown[i] <= d && maxUp[i] <= d) {
      ++cnt;
    }
  }
  cout << cnt << '\n';
}
