#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 9;
const double eps = 1e-5;
const int maxN = 1e5 + 5;
const int inf = 1e9;
int n, m, d, ans;
bool att[maxN];
vector<int> G[maxN];
int dp[maxN];
inline int dfs1(int v, int par) {
  if (att[v])
    dp[v] = 0;
  else
    dp[v] = -inf;
  for (int i = 0; i < G[v].size(); i++) {
    int t = -inf;
    if (G[v][i] != par) t = dfs1(G[v][i], v);
    dp[v] = max(dp[v], t + 1);
  }
  return dp[v];
}
inline void dfs2(int v, int par, int up) {
  if (att[v]) up = max(up, 0);
  int mx1 = -inf, mx2 = -inf;
  int cnt = 0;
  for (int i = 0; i < G[v].size(); i++) {
    if (G[v][i] != par) {
      if (dp[G[v][i]] == mx1) {
        cnt++;
      } else if (dp[G[v][i]] > mx1) {
        swap(mx1, mx2);
        cnt = 1;
        mx1 = dp[G[v][i]];
      } else if (dp[G[v][i]] > mx2) {
        mx2 = dp[G[v][i]];
      }
    }
  }
  mx1++;
  mx2++;
  if (mx1 <= d && up <= d) ans++;
  for (int i = 0; i < G[v].size(); i++) {
    if (G[v][i] != par) {
      int t = dp[G[v][i]];
      int mx = -inf;
      if (t + 1 < mx1 || cnt > 1) {
        mx = max(up, mx1);
      } else {
        mx = max(up, mx2);
      }
      mx++;
      dfs2(G[v][i], v, mx);
    }
  }
}
inline void init() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0, a; i < m; i++) scanf("%d", &a), att[a - 1] = 1;
  for (int i = 0, a, b; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs1(0, -1);
}
inline void solve() {
  dfs2(0, -1, (att[0] == 1 ? 0 : -inf));
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
