#include <bits/stdc++.h>
using namespace std;
int dp1[123456], dp2[123456], fat[123456], dpt[123456], maxl[123456];
vector<int> G[123456];
int tp[123456];
int n, m, k;
void dfs1(int cur, int fa) {
  fat[cur] = fa;
  int id = -1;
  for (int i = 0; i < G[cur].size(); i++) {
    if (G[cur][i] == fa) continue;
    dfs1(G[cur][i], cur);
    if (dp1[G[cur][i]] != -1 && dp1[cur] < dp1[G[cur][i]] + 1)
      dp1[cur] = dp1[G[cur][i]] + 1, id = i;
  }
  maxl[cur] = id;
  if (dp1[cur] == -1 && tp[cur] == 1) dp1[cur] = 0;
  for (int i = 0; i < G[cur].size(); i++)
    if (G[cur][i] != fa && i != id && dp1[G[cur][i]] != -1)
      dpt[cur] = max(dp1[G[cur][i]] + 1, dpt[cur]);
}
int main() {
  memset(dpt, -1, sizeof dpt);
  memset(dp1, -1, sizeof dp1);
  memset(dp2, -1, sizeof dp2);
  memset(maxl, -1, sizeof maxl);
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int t;
    scanf("%d", &t);
    tp[t] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs1(1, -1);
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    int f = fat[u];
    if (f != -1) {
      if (G[f][maxl[f]] != u && dp1[f] != -1) dp2[u] = max(dp2[u], dp1[f] + 1);
      if (G[f][maxl[f]] == u && dpt[f] != -1) dp2[u] = max(dp2[u], dpt[f] + 1);
      if (dp2[f] != -1) dp2[u] = max(dp2[u], dp2[f] + 1);
    } else
      dp2[u] = tp[u] == 1 ? 0 : -1;
    for (int i = 0; i < G[u].size(); i++) {
      if (G[u][i] == fat[u]) continue;
      q.push(G[u][i]);
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (dp2[i] <= k && dp1[i] <= k) ans++;
  }
  cout << ans << endl;
  return 0;
}
