func_code_string: #include <bits/stdc++.h>   using namespace std;   struct road {     int x, next;   } r[100005 * 2];   int N, M, D, ans;   int vis[100005], p[100005];   int down[100005], up[100005];   int st[100005], w;   void add(int x, int y) {     r[++w].x = y, r[w].next = st[x];     st[x] = w;   }   void Make_Down(int x, int fr) {     int i, tmp;     if (vis[x])       down[x] = 0;     else       down[x] = -0x7ffffff;     for (i = st[x]; i; i = r[i].next) {       tmp = r[i].x;       if (tmp == fr) continue;       Make_Down(tmp, x);       down[x] = max(down[x], down[tmp] + 1);     }   }   void Dfs(int x, int fr) {     int i, tmp;     int m1 = 0, m2 = 0;     if (vis[x]) up[x] = max(up[x], 0);     if (max(down[x], up[x]) <= D) ans++;     for (i = st[x]; i; i = r[i].next) {       tmp = r[i].x;       if (tmp == fr) continue;       if (down[m1] <= down[tmp])         m2 = m1, m1 = tmp;       else if (down[m2] <= down[tmp])         m2 = tmp;     }     for (i = st[x]; i; i = r[i].next) {       tmp = r[i].x;       if (tmp == fr) continue;       if (tmp == m1)         up[tmp] = max(up[x] + 1, down[m2] + 2);       else         up[tmp] = max(up[x] + 1, down[m1] + 2);       Dfs(tmp, x);     }   }   int main() {     int i, j;     int fr, to;     scanf( %d %d %d , &N, &M, &D);     for (i = 1; i <= M; i++) scanf( %d , &p[i]), vis[p[i]] = 1;     for (i = 1; i < N; i++) {       scanf( %d %d , &fr, &to);       add(fr, to), add(to, fr);     }     down[0] = up[0] = -0x7ffffff;     memset(up, 200, sizeof(up));     Make_Down(1, 0);     Dfs(1, 0);     printf( %d n , ans);     return 0;   }   