#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(1e8);
const int N_MAX = 100000;
const int M_MAX = N_MAX;
int n, m, d;
int p[M_MAX];
int a[N_MAX - 1];
int b[N_MAX - 1];
vector<int> g[N_MAX + 1];
set<int> q;
int dp[N_MAX + 1];
bool used[N_MAX + 1];
int dfs(int x) {
  dp[x] = -INF;
  used[x] = true;
  for (int i = 0; i < (g[x].size()); ++i)
    if (!used[g[x][i]]) dp[x] = max(dp[x], dfs(g[x][i]) + 1);
  if (q.find(x) != q.end()) dp[x] = max(dp[x], 0);
  return dp[x];
}
int dfs2(int x, int y) {
  if (q.find(x) != q.end()) y = max(y, 0);
  used[x] = true;
  if (y > d) return 0;
  int h = -INF;
  int j = 0;
  int h2 = -INF;
  for (int i = 0; i < (g[x].size()); ++i)
    if (!used[g[x][i]]) {
      if (dp[g[x][i]] + 1 >= h) {
        h2 = h;
        h = dp[g[x][i]] + 1;
        j = i;
      } else if (dp[g[x][i]] + 1 > h2)
        h2 = dp[g[x][i]] + 1;
    }
  int res = 0;
  if (h <= d) res = 1;
  for (int i = 0; i < (g[x].size()); ++i)
    if (!used[g[x][i]]) {
      if (i == j)
        res += dfs2(g[x][i], max(y + 1, h2 + 1));
      else
        res += dfs2(g[x][i], max(y + 1, h + 1));
    }
  return res;
}
void solve() {
  if (d == 0) {
    if (m == 1)
      cout << 1 << endl;
    else
      cout << 0 << endl;
    return;
  }
  for (int i = 0; i < (n - 1); ++i) {
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
  }
  for (int i = 0; i < (m); ++i) q.insert(p[i]);
  dfs(1);
  memset(used, 0, sizeof(used));
  int ans = dfs2(1, -INF);
  cout << ans << endl;
}
int main() {
  cin >> n >> m >> d;
  for (int i = 0; i < (m); ++i) cin >> p[i];
  for (int i = 0; i < (n - 1); ++i) cin >> a[i] >> b[i];
  solve();
  return 0;
}
