func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX = 100005;   const int INF = 1 << 30;   int n, m, D;   int a[MAX];   vector<int> v[MAX];   int down[MAX];   inline void Down(int x, int fa) {     int res = -1;     for (int i = 0; i < v[x].size(); i++) {       int next = v[x][i];       if (next == fa) continue;       Down(next, x);       res = max(res, down[next]);     }     if (res != -1) down[x] = max(down[x], res + 1);   }   int up[MAX];   inline void Up(int x, int fa) {     int max1 = -1, max2 = -1;     for (int i = 0; i < v[x].size(); i++) {       int next = v[x][i];       if (next == fa) continue;       if (down[next] > max1)         max2 = max1, max1 = down[next];       else if (down[next] > max2)         max2 = down[next];     }     int res = -1;     for (int i = 0; i < v[x].size(); i++) {       int next = v[x][i];       if (next == fa) continue;       if (up[x] != -1) up[next] = max(up[next], up[x] + 1);       int val = (down[next] == max1 ? max2 : max1);       if (val != -1) up[next] = max(up[next], val + 2);       Up(next, x);     }   }   int main() {     scanf( %d%d%d , &n, &m, &D);     for (int i = 1; i <= m; i++) scanf( %d , &a[i]);     for (int i = 1; i < n; i++) {       int x, y;       scanf( %d%d , &x, &y);       v[x].push_back(y);       v[y].push_back(x);     }     memset(down, -1, sizeof(down));     memset(up, -1, sizeof(up));     for (int i = 1; i <= m; i++) down[a[i]] = up[a[i]] = 0;     Down(1, 0);     Up(1, 0);     int ans = 0;     for (int i = 1; i <= n; i++)       if (up[i] <= D && down[i] <= D) ans++;     printf( %d n , ans);     return 0;   }   