#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, m, d, t, p[maxn], head[maxn], tot, dn[maxn], up[maxn], v[maxn], dep, st,
    nd, cnt;
struct node {
  int to, nxt;
} e[maxn << 1];
void add(int x, int y) {
  e[++tot] = {y, head[x]};
  head[x] = tot;
}
void dfs1(int now, int fa, int d) {
  if (v[now] && dep < d) dep = d, st = now;
  for (int i = head[now]; ~i; i = e[i].nxt) {
    int to = e[i].to;
    if (to == fa) continue;
    dfs1(to, now, d + 1);
  }
}
void dfs2(int now, int fa, int d) {
  dn[now] = d;
  if (v[now] && dep < d) dep = d, nd = now;
  for (int i = head[now]; ~i; i = e[i].nxt) {
    int to = e[i].to;
    if (to == fa) continue;
    dfs2(to, now, d + 1);
  }
}
void dfs3(int now, int fa, int d) {
  up[now] = d;
  for (int i = head[now]; ~i; i = e[i].nxt) {
    int to = e[i].to;
    if (to == fa) continue;
    dfs3(to, now, d + 1);
  }
}
int main() {
  cin >> n >> m >> d;
  memset(head, -1, sizeof(head));
  for (int i = 1; i <= m; i++) cin >> t, v[t] = 1;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    add(u, v);
    add(v, u);
  }
  dep = -1;
  dfs1(1, 0, 0);
  dep = -1;
  dfs2(st, 0, 0);
  dep = -1;
  dfs3(nd, 0, 0);
  for (int i = 1; i <= n; i++)
    if (dn[i] <= d && up[i] <= d) cnt++;
  cout << cnt << endl;
  return 0;
}
