#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) { return (a > b ? a : b); }
long long int min(long long int a, long long int b) { return (a < b ? a : b); }
long long int ceil_div(long long int a, long long int b) {
  return (a + b - 1) / b;
}
const long long int N = 3e5 + 5, INF = 2e9 + 2, MOD = 1e9 + 7, M = 6000,
                    K = 1e7;
std::vector<int> v[N];
int p[N], mh1[N], mh2[N], h[N];
bool b[N];
int d;
void dfs(int u, int pp) {
  h[u] = h[pp] + 1;
  mh1[u] = -INF;
  mh2[u] = -INF;
  for (auto w : v[u]) {
    if (w == pp) continue;
    dfs(w, u);
    if (mh1[w] > -INF && mh1[u] <= mh1[w] + 1) {
      mh2[u] = mh1[u];
      mh1[u] = mh1[w] + 1;
    } else if (mh1[w] > -INF && mh2[u] <= mh1[w] + 1)
      mh2[u] = mh1[w] + 1;
  }
  if (mh1[u] == -INF && b[u])
    mh1[u] = 0;
  else if (mh2[u] == -INF && mh1[u] != -INF && b[u])
    mh2[u] = 0;
}
int dfs2(int u, int pp, int lm) {
  long long int ans = 1, tp;
  if (mh1[u] == -INF && lm == 0) return 1;
  if (lm + d < mh1[u]) return -INF;
  if (lm < 0) return 0;
  if (mh1[u] > d) ans = 0;
  for (auto w : v[u]) {
    if (w == pp) continue;
    if (mh1[u] == -INF) {
      ans += dfs2(w, u, lm - 1);
    } else if (mh1[w] + 1 == mh1[u]) {
      if (mh2[u] != -INF)
        tp = dfs2(w, u, min(lm - 1, d - mh2[u] - 1));
      else
        tp = dfs2(w, u, lm - 1);
      if (tp == -INF) return -INF;
      ans += tp;
    } else {
      tp = dfs2(w, u, min(lm - 1, d - mh1[u] - 1));
      if (tp == -INF) return -INF;
      ans += tp;
    }
  }
  return ans;
}
int main() {
  cin.sync_with_stdio(false), cin.tie(NULL);
  int n, m;
  cin >> n >> m >> d;
  int u, w;
  fill(b, b + N, false);
  for (int i = 0; i < m; i++) {
    cin >> u;
    b[u] = true;
  }
  for (int i = 1; i < n; i++) {
    cin >> u >> w;
    v[u].push_back(w);
    v[w].push_back(u);
  }
  dfs(1, 0);
  cout << max(0, dfs2(1, 0, n)) << "\n";
  return 0;
}
