#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265;
const long long M = 100005;
vector<long long> adj[M];
long long maxdistdown[M], maxdistup[M], mark[M];
void dfs1(long long x, long long p) {
  maxdistdown[x] = (mark[x] ? 0 : -1);
  for (auto i : adj[x]) {
    if (i != p) {
      dfs1(i, x);
      if (maxdistdown[i] != -1)
        maxdistdown[x] = max(maxdistdown[x], maxdistdown[i] + 1);
    }
  }
}
void dfs2(long long x, long long p) {
  long long mx1 = -1, mx2 = -1;
  for (auto i : adj[x]) {
    if (i != p) {
      if (maxdistdown[i] > mx1)
        mx2 = mx1, mx1 = maxdistdown[i];
      else if (maxdistdown[i] > mx2)
        mx2 = maxdistdown[i];
    }
  }
  for (auto i : adj[x]) {
    if (i != p) {
      maxdistup[i] = (maxdistdown[i] == mx1) ? mx2 : mx1;
      if (maxdistup[i] != -1) maxdistup[i] += 2;
      if (maxdistup[x] != -1)
        maxdistup[i] = max(maxdistup[i], maxdistup[x] + 1);
      if (mark[i]) maxdistup[i] = max(maxdistup[i], 0LL);
      dfs2(i, x);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, d;
  cin >> n >> m >> d;
  for (long long i = 1; i <= m; i++) {
    long long r;
    cin >> r;
    mark[r] = 1;
  }
  for (long long i = 1; i <= n - 1; i++) {
    long long r, q;
    cin >> r >> q;
    adj[r].push_back(q);
    adj[q].push_back(r);
  }
  maxdistup[0] = maxdistup[1] = -1;
  if (mark[1]) maxdistup[1] = 0;
  dfs1(1, 0);
  dfs2(1, 0);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (maxdistup[i] <= d && maxdistdown[i] <= d) ans++;
  }
  cout << ans;
}
