You are given a tree with n vertices enumerated from 0 to n−1 inclusive. There is a number in each vertex. Numbers are from 0 to n−1 and are all distinct (i.e. they form a permutation). The number x is in its place if it is in the x-th vertex.
You are allowed to swap two numbers at the endpoints of some edge of the tree. This costs you 0 if at least one of those numbers was in its place before the swap and 1 otherwise.
What is the minimum cost you have to pay to put all numbers in their places?
The first line contains a single integer n (2≤n≤105), the number of vertices of the tree.
The second line contains n−1 integers p_i (0≤p_i<i). i-th of them describes an edge between vertices p_i and i.
The third line contains n integers a_i (0≤a_i<n). i-th of them (in zero based indexing) is equal to the number which is initially in the i-th vertex. a is a permutation.
Print a single integer --- the minimum cost you have to pay.