You are give two rooted tree

with n vertices. For each tree, every vertex has a distinct integer label in [1,n]. You want to change the label of vertices in

, and make two trees identical. After Two trees are identical iff
- The labels of their roots are the same.
- For a non-root vertices with label u, the labels of their parent should also be the same.
After the modification, the label of

should also be a permutation of

.
You want to minimize the number of vertices whose labels are changed.
The following is an example (The order of children doesn't matter):