#include <bits/stdc++.h>
using namespace std;
long long in[100009], out[100009];
long long mark[100009];
vector<long long> adj[100009];
void dfs(long long src, long long par) {
  if (mark[src] == 1)
    in[src] = 0;
  else
    in[src] = INT_MIN;
  for (int i = 0; i < adj[src].size(); i++) {
    if (adj[src][i] == par) continue;
    dfs(adj[src][i], src);
    in[src] = max(in[src], 1 + in[adj[src][i]]);
  }
}
void dfs2(long long src, long long par) {
  long long a = INT_MIN, b = INT_MIN, mx;
  for (int i = 0; i < adj[src].size(); i++) {
    if (adj[src][i] == par) continue;
    if (in[adj[src][i]] > a) {
      b = a;
      a = in[adj[src][i]];
    } else if (in[adj[src][i]] > b) {
      b = in[adj[src][i]];
    }
  }
  for (int i = 0; i < adj[src].size(); i++) {
    if (adj[src][i] == par) continue;
    mx = a;
    if (in[adj[src][i]] == mx) mx = b;
    out[adj[src][i]] = max(1 + out[src], 2 + mx);
    if (mark[adj[src][i]] && out[adj[src][i]] < 0) out[adj[src][i]] = 0;
    dfs2(adj[src][i], src);
  }
}
int main() {
  long long n, m, d;
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    mark[x] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1, 0);
  out[1] = INT_MIN;
  if (mark[1]) out[1] = 0;
  dfs2(1, 0);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += (in[i + 1] <= d && out[i + 1] <= d);
  }
  cout << ans << endl;
}
