#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const int maxn = 5e5 + 1000, mod = 1e9 + 7;
const double eps = 1e-9;
int cmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
void add(int &x, int y) {
  if (y >= mod) y -= mod;
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
}
void mul(int &x, int y) { x = 1ll * x * y % mod; }
long long powmod(long long x, long long n) {
  long long ret = 1;
  for (; n > 0; n >>= 1, x = x * x % mod)
    if (n & 1) ret = ret * x % mod;
  return ret;
}
int n, k, m, isv[maxn];
vector<int> v[maxn];
int down[maxn][2], id[maxn], up[maxn];
void dfs(int x, int pre) {
  down[x][0] = -inf, down[x][1] = -inf;
  for (auto &u : v[x]) {
    if (u == pre) continue;
    dfs(u, x);
    if (down[x][0] < down[u][0] + 1) down[x][0] = down[u][0] + 1, id[x] = u;
  }
  for (auto &u : v[x]) {
    if (u == pre || u == id[x]) continue;
    down[x][1] = max(down[u][0] + 1, down[x][1]);
  }
  if (isv[x]) {
    if (down[x][0] < 0) down[x][0] = 0, id[x] = -1;
  }
}
void dfs2(int x, int pre) {
  for (auto &u : v[x]) {
    if (u == pre) continue;
    if (u == id[x]) {
      up[u] = max(up[x], down[x][1]) + 1;
    } else {
      up[u] = max(up[x], down[x][0]) + 1;
    }
    dfs2(u, x);
  }
}
int vis[maxn], tab[maxn], deep[maxn];
void DP(int x, int pre) {
  deep[x] = deep[pre] + 1;
  for (auto &u : v[x]) {
    if (u == pre) continue;
    DP(u, x);
  }
}
int fo() {
  int ans = 0;
  for (int i = 1; i < (1 << m); ++i) {
    for (int j = 0; j <= n + 10; ++j) vis[j] = 0, deep[j] = 0;
    for (int j = 0; j < m; ++j) {
      if (i >> j & 1) vis[tab[j]] = 1;
    }
    bool ok = 0;
    for (int j = 0; j < m; ++j) {
      int now = tab[j];
      if (i >> j & 1) {
        DP(now, 0);
        for (int l = 1; l <= n; ++l) {
          if (vis[l] && !(deep[l] <= k + 1)) ok = 1;
          if (ok) break;
        }
      }
      if (ok) break;
    }
    if (!ok) ans++;
  }
  return ans;
}
int main() {
  while (cin >> n >> m >> k) {
    for (int i = 0; i <= n + 10; ++i) {
      v[i].clear();
      isv[i] = 0;
    }
    for (int i = 1; i <= m; ++i) {
      int c;
      cin >> c;
      isv[c] = 1;
    }
    for (int i = 2; i <= n; ++i) {
      int x, y;
      cin >> x >> y;
      v[x].push_back(y);
      v[y].push_back(x);
    }
    dfs(1, -1);
    up[1] = -inf;
    if (isv[1]) up[1] = 0;
    dfs2(1, -1);
    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
      int x = max(down[i][0], up[i]);
      if (x <= k) {
        cnt++;
      }
    }
    cout << cnt << '\n';
  }
  return 0;
}
