#include <bits/stdc++.h>
using namespace std;
long long f[100002], g[100002], s[100002];
vector<long long> v[100002];
vector<long long> fp[100002];
vector<long long> fs[100002];
long long inf = 1e18;
void dfs(long long x, long long p) {
  for (auto y : v[x])
    if (y != p) {
      dfs(y, x);
      if (f[y] >= 0) f[x] = max(f[x], f[y] + 1);
    }
  long long ddd = v[x].size();
  if (ddd == 0) return;
  fp[x][0] = (v[x][0] == p) ? -1 : f[v[x][0]];
  for (long long i = 1; i <= ddd - 1; i++) {
    long long nd = v[x][i];
    fp[x][i] = fp[x][i - 1];
    if (nd != p) fp[x][i] = max(fp[x][i], f[nd]);
  }
  fs[x][ddd - 1] = (v[x][ddd - 1] == p) ? -1 : f[v[x][ddd - 1]];
  for (long long i = ddd - 2; i >= 0; i--) {
    long long nd = v[x][i];
    fs[x][i] = fs[x][i + 1];
    if (nd != p) fs[x][i] = max(fs[x][i], f[nd]);
  }
}
void dfs1(long long x, long long p, long long ii) {
  g[x] = (s[x] == 0) ? s[x] : -1;
  if (x != 1) {
    if (g[p] >= 0) g[x] = max(g[x], 1 + g[p]);
    long long xx;
    if (ii > 0) {
      xx = fp[p][ii - 1];
      if (xx >= 0) g[x] = max(g[x], 2 + xx);
    }
    if (ii < (int)v[p].size() - 1) {
      xx = fs[p][ii + 1];
      if (xx >= 0) g[x] = max(g[x], 2 + xx);
    }
  }
  long long iii = 0;
  for (auto y : v[x]) {
    if (y != p) dfs1(y, x, iii);
    iii++;
  }
}
int main() {
  long long n, m, d;
  cin >> n >> m >> d;
  memset(f, 0, sizeof(f));
  long long x, y;
  memset(f, -1, sizeof(f));
  memset(s, -1, sizeof(s));
  for (long long i = 1; i <= m; i++) cin >> x, f[x] = 0, s[x] = 0;
  for (long long i = 1; i <= n - 1; i++)
    cin >> x >> y, v[x].push_back(y), v[y].push_back(x), fs[x].push_back(-1),
        fs[y].push_back(-1), fp[x].push_back(-1), fp[y].push_back(-1);
  dfs(1, 0);
  dfs1(1, 0, 0);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (f[i] <= d and g[i] <= d) ans++;
  }
  cout << ans << endl;
}
