func_code_string: #include <bits/stdc++.h>   using namespace std;   inline long long max(long long a, long long b) { return (a > b) ? a : b; }   inline long long min(long long a, long long b) { return (a < b) ? a : b; }   inline long long gcd(long long a, long long b) {     if (b == 0) return a;     return gcd(b, a % b);   }   vector<vector<long long> > graph;   vector<long long> color, initial;   long long cnt = 0;   void bfs(long long source, long long n, long long colour) {     queue<long long> q;     q.push(source);     bool visited[n + 1];     fill(visited, visited + n + 1, false);     visited[source] = true;     while (!q.empty()) {       long long u = q.front();       q.pop();       for (auto c : graph[u]) {         if (visited[c] == false) {           q.push(c);           visited[c] = true;           initial[c] = colour;         }       }     }   }   int main() {     ;     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n;     cin >> n;     graph.resize(n + 1);     for (long long i = 2; i <= n; i++) {       long long a;       cin >> a;       graph[a].push_back(i);     }     initial.resize(n + 1, -1);     color.resize(n + 1, 0);     for (long long i = 1; i <= n; i++) {       cin >> color[i];       if (initial[i] == color[i]) continue;       cnt++;       initial[i] = color[i];       bfs(i, n, color[i]);     }     cout << cnt;     cout <<   n ;   }   