#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double eps = 1e-8;
const int maxn = 300000;
int n, m, d;
int dp[maxn][2];
vector<int> g[maxn];
int vis[maxn];
int Max[maxn];
int SecMax[maxn];
void dfs1(int u, int fa) {
  for (int i = (0); i < (g[u].size()); ++i) {
    if (g[u][i] == fa) continue;
    int v = g[u][i];
    dfs1(v, u);
    dp[u][0] = max(dp[u][0], dp[v][0] + 1);
    if (dp[v][0] + 1 > SecMax[u]) {
      SecMax[u] = dp[v][0] + 1;
      if (SecMax[u] > Max[u]) swap(SecMax[u], Max[u]);
    }
  }
}
void dfs2(int u, int fa) {
  for (int i = (0); i < (g[u].size()); ++i) {
    if (g[u][i] == fa) continue;
    if (dp[g[u][i]][0] + 1 == Max[u])
      dp[g[u][i]][1] = max(dp[g[u][i]][1], max(SecMax[u], dp[u][1]) + 1);
    else
      dp[g[u][i]][1] = max(dp[g[u][i]][1], max(Max[u], dp[u][1]) + 1);
    int v = g[u][i];
    dfs2(v, u);
  }
}
int main() {
  while (cin >> n >> m >> d) {
    for (int i = (1); i <= (n); ++i) {
      dp[i][0] = dp[i][1] = -INF;
      Max[i] = -INF;
      SecMax[i] = -INF;
    }
    memset(vis, 0, sizeof(vis));
    for (int i = (1); i <= (m); ++i) {
      int a;
      scanf("%d", &a);
      vis[a] = 1;
      dp[a][0] = 0;
      dp[a][1] = 0;
    }
    for (int i = (1); 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);
    dfs2(1, -1);
    int ans = 0;
    for (int i = (1); i <= (n); ++i) {
      if (dp[i][0] <= d && dp[i][1] <= d) ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
