### ** Single Flip**

### Description

Given two permutations \(A\) and \(B\) of length \(N\). You have to select an index \(x\) (\(1 \le x \le N\)) and swap the values of \(A_x\) and \(B_x\). Count the number of indices \(x\) that allows \(A\) and \(B\) to remain as permutations after swapping the index.

Note: A permutation of length \(N\) is a sequence of \(N\) integers from \(1\) to \(N\) such that each element appears exactly once in the sequence.

### Constraints

- \(1 \le N \le 100\)
- \(1 \le A_i \le N\)
- \(1 \le B_i \le N\)
- \(A\) and \(B\) are permutations.

N
A_{1} A_{2} … A_{N}
B_{1} B_{2} … B_{N}

### Output

A single integer representing the number of indices such that \(A\) and \(B\) remain as permutations after swapping.

```
5
1 2 3 4 5
5 2 3 1 4
```

### Sample Output

`2`

### Explanation

We can select indices \(2\) or \(3\), and both \(A\) and \(B\) will remain as permutations after swapping.