Summer is coming! And for Miguel's family, it means a celebration is coming, but they are a pretty weird family. Not only do they hate music and celebrate summer, but they are also shoemakers, so his mother Coco gifts the whole family with a pair of shoes every year.
However, this year Miguel's dog has made a mess and the shoes got all mixed up. Everyone got a left shoe and a right shoe, but not necessarily the shoes they were supposed to get. So now they have asked for your help to get everyone their shoes.
To do this, two people can swap a shoe between them, but only if they are of the same side (they can only swap a left shoe with a left shoe and a right shoe with a right shoe). They want to know what is the minimum number of swaps they need to do so everyone ends with their shoe.
The first line contains a number $$$N$$$ ($$$1\leq N\leq 10^6$$$) indicating the number of people in the family.
The second line contains $$$N$$$ numbers $$$a_1,...,a_N$$$ ($$$1\leq a_i\leq N$$$). The i-th number indicates who is the owner of the right shoe the i-th person has.
The third line contains $$$N$$$ numbers $$$b_1,...,b_N$$$ ($$$1\leq b_i\leq N$$$). The i-th number indicates who is the owner of the left shoe the i-th person has.
Print a line with a number $$$k$$$, the minimum number of swaps they need to do so everyone has their shoes.
21 22 1
1
31 3 22 1 3
2
54 5 1 2 33 1 4 5 2
8