#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void rd(T &x) {
  x = 0;
  bool f = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - 48, c = getchar();
  if (f) x = -x;
}
const int N = 100005;
int n, m, d, dp[N][2], dis[N], flag[N], ans;
vector<int> e[N];
void dfs(int u, int fa) {
  if (flag[u]) dp[u][0] = 0, dp[u][1] = 0;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (v == fa) continue;
    dfs(v, u);
    if (dp[u][0] < dp[v][0] + 1) {
      dp[u][1] = dp[u][0];
      dp[u][0] = dp[v][0] + 1;
    } else
      dp[u][1] = max(dp[u][1], dp[v][0] + 1);
  }
}
void dfs2(int u, int fa) {
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (v == fa) continue;
    if (dp[u][0] == dp[v][0] + 1)
      dis[v] = max(dis[u] + 1, dp[u][1] + 1);
    else
      dis[v] = max(dis[u] + 1, dp[u][0] + 1);
    dfs2(v, u);
  }
}
int main() {
  memset(dp, -120, sizeof(dp));
  memset(dis, -120, sizeof(dis));
  rd(n), rd(m), rd(d);
  for (int i = 1; i <= m; i++) {
    int x;
    rd(x);
    flag[x] = 1;
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    rd(x), rd(y);
    e[x].push_back(y), e[y].push_back(x);
  }
  dfs(1, 0);
  dfs2(1, 0);
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      if (dp[i][0] <= d && dp[i][1] <= d) ans++;
    } else if (dis[i] <= d && dp[i][0] <= d)
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
