func_code_string: #include <bits/stdc++.h>   using namespace std;   bool visited[100005] = {0};   vector<int> v[100005];   int color[100005];   int dfs(int s) {     int result = 0;     visited[s] = 1;     for (int i = 0; i < v[s].size(); i++) {       if (!visited[v[s][i]]) {         if (color[v[s][i]] != color[s])           result += (1 + dfs(v[s][i]));         else           result += dfs(v[s][i]);       }     }     return result;   }   int main() {     int n;     cin >> n;     for (int i = 0; i < 100005; i++) visited[i] = 0;     for (int i = 2; i <= n; i++) {       int a;       cin >> a;       v[i].push_back(a);       v[a].push_back(i);     }     for (int i = 0; i < n; i++) {       cin >> color[i + 1];     }     cout << (1 + dfs(1)) << endl;     return 0;   }   