#include <bits/stdc++.h>
using namespace std;
int n, m, d;
int mark[100005];
vector<vector<int> > adj(100001);
int in[100005], out[100005];
void dfs1(int u, int par) {
  if (mark[u])
    in[u] = 0;
  else
    in[u] = -2e5;
  for (int i = 0; i < adj[u].size(); i++) {
    if (adj[u][i] == par) continue;
    dfs1(adj[u][i], u);
    in[u] = max(in[u], 1 + in[adj[u][i]]);
  }
}
void dfs_out(int u, int par) {
  int mx1 = -2e5, mx2 = -2e5;
  for (int i = 0; i < adj[u].size(); i++) {
    if (adj[u][i] == par) continue;
    if (in[adj[u][i]] >= mx1) {
      mx2 = mx1;
      mx1 = in[adj[u][i]];
    } else if (in[adj[u][i]] > mx2)
      mx2 = in[adj[u][i]];
  }
  for (int i = 0; i < adj[u].size(); i++) {
    if (adj[u][i] == par) continue;
    int use = mx1;
    if (in[adj[u][i]] == mx1) use = mx2;
    out[adj[u][i]] = max(1 + out[u], 2 + use);
    if (mark[adj[u][i]] && out[adj[u][i]] < 0) out[adj[u][i]] = 0;
    dfs_out(adj[u][i], u);
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 1; i <= n; i++) {
    mark[i] = 0;
    in[i] = - -2e5;
  }
  while (m--) {
    int dd;
    cin >> dd;
    mark[dd] = 1;
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs1(1, 0);
  if (mark[1])
    out[1] = 0;
  else
    out[1] = -2e5;
  dfs_out(1, 0);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (in[i] <= d && out[i] <= d) ans++;
  }
  cout << ans << '\n';
  return 0;
}
