#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
inline int read() {
  int s = 0, w = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
int n, m, D, evil[N], L, R, book[N], Ldis[N], Rdis[N], maxx = -1;
int head[N], maxE;
struct Edge {
  int nxt, to;
} e[N];
inline void Add(int u, int v) {
  e[++maxE].nxt = head[u];
  head[u] = maxE;
  e[maxE].to = v;
}
void DFS1(int x, int dep) {
  book[x] = 1;
  if (dep > maxx && evil[x]) maxx = dep, L = x;
  for (int i = head[x]; i; i = e[i].nxt) {
    if (book[e[i].to]) continue;
    DFS1(e[i].to, dep + 1);
  }
}
void DFS2(int x, int dep) {
  book[x] = 1, Ldis[x] = dep;
  if (dep > maxx && evil[x]) maxx = dep, R = x;
  for (int i = head[x]; i; i = e[i].nxt) {
    if (book[e[i].to]) continue;
    DFS2(e[i].to, dep + 1);
  }
}
void DFS3(int x, int dep) {
  book[x] = 1, Rdis[x] = dep;
  for (int i = head[x]; i; i = e[i].nxt) {
    if (book[e[i].to]) continue;
    DFS3(e[i].to, dep + 1);
  }
}
int main() {
  n = read(), m = read(), D = read();
  for (register int i = 1; i <= m; i++) {
    int x = read();
    evil[x] = 1;
  }
  for (register int i = 1; i < n; i++) {
    int u = read(), v = read();
    Add(u, v), Add(v, u);
  }
  DFS1(1, 0);
  memset(book, 0, sizeof(book)), maxx = -1;
  DFS2(L, 0);
  memset(book, 0, sizeof(book)), maxx = -1;
  DFS3(R, 0);
  memset(book, 0, sizeof(book)), maxx = -1;
  int res = 0;
  for (register int i = 1; i <= n; i++)
    res += ((Ldis[i] <= D) && (Rdis[i] <= D));
  printf("%d\n", res);
  return 0;
}
