func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 50;   deque<int> dq;   bool is[N], can[N];   vector<vector<int> > adj(N);   int n, m, d, cur, mx, ans[N], x;   void dfs(int u, int p) {     ans[u] = ans[p] + 1;     can[u] &= (ans[u] <= d);     if (ans[u] > mx && is[u]) mx = ans[u], x = u;     for (auto v : adj[u])       if (v != p) dfs(v, u);   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> d;     ans[0] = -1;     memset(can, 1, sizeof can);     for (int i = 0; i < m; i++) cin >> x, is[x] = 1;     for (int i = 1, u, v; i < n; i++) {       cin >> u >> v;       adj[u].push_back(v);       adj[v].push_back(u);     }     dq.push_front(x);     while (dq.size()) {       int now = dq.front();       dfs(now, 0);       dq.pop_front();       if (now != x) dq.push_front(x);     }     int s = 0;     for (int i = 1; i <= n; i++) s += can[i];     cout << s;   }   