func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937 myrand(time(0));   bool isprime(long long n) {     if (n <= 1) return false;     if (n <= 3) return true;     if (n % 2 == 0 || n % 3 == 0) return false;     for (long long i = 5; i * i <= n; i += 6) {       if (n % i == 0 || n % (i + 2) == 0) return false;     }     return true;   }   long long modexp(long long a, long long b, long long m) {     long long r = 1;     a = a % m;     while (b > 0) {       if (b & 1) r = (r * a) % m;       b = b >> 1;       a = (a * a) % m;     }     return r % m;   }   long long builtin_popcount(long long x) {     long long cnt = 0;     for (long long i = 60; i >= 0; i--) {       if ((1LL << i) & x) cnt++;     }     return cnt;   }   long long addmod(long long a, long long b) {     a %= 1000000007;     b %= 1000000007;     return (a + b) % 1000000007;   }   long long mulmod(long long a, long long b) {     a %= 1000000007;     b %= 1000000007;     return (a * b) % 1000000007;   }   long long submod(long long a, long long b) {     a %= 1000000007;     b %= 1000000007;     a -= b;     if (a < 0) a += 1000000007;     return a % 1000000007;   }   struct CustomCompare {     bool operator()(pair<long long, long long> a, pair<long long, long long> b) {       return a.first < b.first;     }   };   long long n, m, d;   vector<vector<long long> > g;   vector<long long> arr;   void dfs(long long src, vector<long long> &dp, long long par = -1) {     dp[src] = (par != -1 ? dp[par] + 1LL : 0LL);     for (auto x : g[src]) {       if (x != par) dfs(x, dp, src);     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> d;     g = vector<vector<long long> >(n);     arr = vector<long long>(m);     vector<long long> vis(n, 0);     for (int i = 0; i < m; i++) cin >> arr[i], arr[i]--, vis[arr[i]] = 1;     for (int i = 1; i < n; i++) {       long long u, v;       cin >> u >> v;       --u, --v;       g[u].push_back(v), g[v].push_back(u);     }     vector<long long> dp(n, 0);     dfs(0, dp);     long long a = -1, mx = -1000000007;     for (int i = 0; i < n; i++) {       if (mx < dp[i] && vis[i]) {         mx = dp[i];         a = i;       }       dp[i] = 0;     }     dfs(a, dp);     long long b = -1;     mx = -1000000007;     for (int i = 0; i < n; i++) {       if (mx < dp[i] && vis[i]) {         mx = dp[i];         b = i;       }     }     vector<long long> dp2(n);     dfs(b, dp2);     long long ans = 0;     for (int i = 0; i < n; i++)       if (dp[i] <= d && dp2[i] <= d) ans++;     cout << ans <<   n ;     return 0;   }   