Y is alone too and has a permutation p1,p2,...,pn of numbers from 1 to n.
Y thinks that a permutation p1,p2,...,pn beautifulness is defined as value of ∑|pi−i|,1≤i≤n.
Y can swap two elements of the permutation at most once, what is the maximum beautifulness that Y can get?
Input
First line contains only n.
Second line contains the permutation p1,p2,...,pn separated by space.
1≤n≤105
1≤pi≤n, all pi are distinct.
Output
The only line of output contains an integer, maximum beautifulness that Y can get.
Y can swap 1th and 5th element and the permutation becomes 5,4,2,3,1 with beautifulness |5−1|+|4−2|+|2−3|+|3−4|+|5−1|=12.