#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int T, n, m, uu, vv, idx, t, d;
int to[N * 2], nxt[N * 2], head[N * 2], p[N], mx[2][N], out[N];
bitset<N> inf;
void addEdge(int u, int v) {
  to[idx] = v;
  nxt[idx] = head[u];
  head[u] = idx;
  ++idx;
}
int dfs1(int node = 0, int par = -1) {
  mx[0][node] = mx[1][node] = -2;
  p[node] = par;
  if (inf[node]) mx[0][node] = 0;
  for (int e = head[node]; ~e; e = nxt[e]) {
    int v = to[e];
    if (v == par) continue;
    int val = dfs1(v, node) + 1;
    if (val > 0) {
      if (val > mx[0][node]) {
        mx[1][node] = mx[0][node];
        mx[0][node] = val;
      } else if (val > mx[1][node]) {
        mx[1][node] = val;
      }
    }
  }
  return mx[0][node];
}
int dfs2(int node) {
  int par = p[node];
  int &ans = out[node];
  if (ans != -1) return ans;
  if (par == -1) return ans;
  if (mx[0][par] == mx[0][node] + 1) {
    ans = max(ans, 1 + mx[1][par]);
  } else {
    ans = max(ans, 1 + mx[0][par]);
  }
  int ttt = dfs2(par);
  if (ttt > -1) ans = max(ans, 1 + ttt);
  return ans;
}
int main() {
  memset(head, -1, sizeof head);
  memset(out, -1, sizeof out);
  memset(mx, -1, sizeof mx);
  scanf("%d %d %d", &n, &m, &d);
  for (int x = 0; x < m; ++x) {
    scanf("%d", &t);
    --t;
    inf[t] = 1;
  }
  for (int i = 1; i < n; ++i) {
    scanf("%d %d", &uu, &vv);
    --uu, --vv;
    addEdge(uu, vv);
    addEdge(vv, uu);
  }
  if (!m) {
    printf("%d\n", n);
    return 0;
  }
  dfs1();
  int ans = 0;
  if (mx[0][0] <= d) ++ans;
  for (int i = 1; i < n; ++i) {
    if (max(mx[0][i], dfs2(i)) <= d) {
      ++ans;
    }
  }
  printf("%d\n", ans);
}
