#include <bits/stdc++.h>
using namespace std;
long long n, m, d, x, y, s, f, tmp, ans1, ans2, answer, maks, a[100005],
    par[100005];
vector<long long> v[100005], w;
bitset<100005> vis, b;
void dfs(long long x, long long y) {
  vis[x] = true;
  if (b[x] && maks < y) {
    maks = y;
    f = x;
  }
  for (int i = 0; i < v[x].size(); i++) {
    if (!vis[v[x][i]]) {
      par[v[x][i]] = x;
      dfs(v[x][i], y + 1);
    }
  }
}
void find(long long x, long long y) {
  vis[x] = false;
  if (y <= d) {
    answer++;
  }
  for (int i = 0; i < v[x].size(); i++) {
    if (vis[v[x][i]]) {
      find(v[x][i], y + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> d;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    b[x] = true;
  }
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) {
    vis[i] = false;
  }
  s = f, maks = 0, par[s] = s;
  dfs(f, 0);
  tmp = f;
  while (tmp != s) {
    vis[tmp] = false;
    w.push_back(tmp);
    tmp = par[tmp];
  }
  w.push_back(s);
  vis[s] = false, ans1 = maks, ans2 = 0;
  for (int i = 0; i < w.size(); i++) {
    find(w[i], max(ans1, ans2));
    ans1--, ans2++;
  }
  cout << answer << '\n';
}
