#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, inf = 23333333;
inline long long rd() {
  long long x = 0;
  char c = getchar();
  int neg = 1;
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * neg;
}
int f[maxn], g[maxn];
int eg[maxn * 2][2], egh[maxn], ect;
int N, M, D;
bool hav[maxn];
inline void adeg(int a, int b) {
  eg[++ect][0] = b, eg[ect][1] = egh[a];
  egh[a] = ect;
}
inline void dfs1(int x, int fa) {
  if (hav[x])
    f[x] = 0;
  else
    f[x] = -inf;
  for (int i = egh[x]; i; i = eg[i][1]) {
    int b = eg[i][0];
    if (b == fa) continue;
    dfs1(b, x);
    f[x] = max(f[x], f[b] + 1);
  }
}
inline void dfs2(int x, int fa) {
  int ma = -inf, se = -inf;
  if (hav[x]) g[x] = max(g[x], 0);
  for (int i = egh[x]; i; i = eg[i][1]) {
    int b = eg[i][0];
    if (b == fa) continue;
    if (f[b] + 2 >= ma)
      se = ma, ma = f[b] + 2;
    else if (f[b] + 2 > se)
      se = f[b] + 2;
  }
  for (int i = egh[x]; i; i = eg[i][1]) {
    int b = eg[i][0];
    if (b == fa) continue;
    if (f[b] + 2 == ma)
      g[b] = se;
    else
      g[b] = ma;
    g[b] = max(g[b], g[x] + 1);
    dfs2(b, x);
  }
}
int main() {
  int i, j, k;
  N = rd(), M = rd(), D = rd();
  for (i = 1; i <= M; i++) {
    int x = rd();
    hav[x] = 1;
  }
  for (i = 1; i < N; i++) {
    int a = rd(), b = rd();
    adeg(a, b);
    adeg(b, a);
  }
  memset(g, -127, sizeof(g));
  dfs1(1, 0);
  dfs2(1, 0);
  int ans = 0;
  for (i = 1; i <= N; i++) {
    if (max(f[i], g[i]) <= D) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
