You are given a permutation of .
You may choose two integers with and reverse the contiguous subsequence .
You must perform this operation exactly once.
Find the minimum possible number of integers () such that after the operation.
Input
The input is given in the following format.
Output
Print the minimum possible number of integers such that after the operation.
Constraints
- .
- ().
- ().
Subtasks
Samples
예제 1
입력
5
1 2 3 4 5
출력
1
예제 2
입력
4
2 1 4 3
출력
0