#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:102400000,102400000 )   using namespace std;   vector<int> G[20000];   int fa[20000], c[20000], ans = 0;   void dfs(int x, int f, int col, int ori) {     if (col != ori) ans++;     for (int i = 0; i < G[x].size(); i++) {       int u = G[x][i];       if (u == f) continue;       dfs(u, x, c[u], col);     }   }   int main() {     std::ios::sync_with_stdio(0), cin.tie(0);     int n, x;     cin >> n;     for (int i = 1; i <= n; i++) G[i].clear();     for (int i = 1; i < n; i++) {       cin >> x;       G[i + 1].push_back(x);       G[x].push_back(i + 1);     }     for (int i = 1; i <= n; i++) cin >> c[i];     dfs(1, -1, c[1], 0);     cout << ans << endl;     return 0;   }   