Some time ago Mister B detected a strange signal from the space, which he started to study.

After some transformation the signal turned out to be a permutation p of length n or its cyclic shift. For the further investigation Mister B need some basis, that's why he decided to choose cyclic shift of this permutation which has the minimum possible deviation.

Let's define the deviation of a permutation p as <image>.

Find a cyclic shift of permutation p with minimum possible deviation. If there are multiple solutions, print any of them.

Let's denote id k (0 ≤ k < n) of a cyclic shift of permutation p as the number of right shifts needed to reach this shift, for example:

  * k = 0: shift p1, p2, ... pn, 
  * k = 1: shift pn, p1, ... pn - 1, 
  * ..., 
  * k = n - 1: shift p2, p3, ... pn, p1. 

Input

First line contains single integer n (2 ≤ n ≤ 106) — the length of the permutation.

The second line contains n space-separated integers p1, p2, ..., pn (1 ≤ pi ≤ n) — the elements of the permutation. It is guaranteed that all elements are distinct.

Output

Print two integers: the minimum deviation of cyclic shifts of permutation p and the id of such shift. If there are multiple solutions, print any of them.

Examples

Input

3
1 2 3


Output

0 0


Input

3
2 3 1


Output

0 1


Input

3
3 2 1


Output

2 1

Note

In the first sample test the given permutation p is the identity permutation, that's why its deviation equals to 0, the shift id equals to 0 as well.

In the second sample test the deviation of p equals to 4, the deviation of the 1-st cyclic shift (1, 2, 3) equals to 0, the deviation of the 2-nd cyclic shift (3, 1, 2) equals to 4, the optimal is the 1-st cyclic shift.

In the third sample test the deviation of p equals to 4, the deviation of the 1-st cyclic shift (1, 3, 2) equals to 2, the deviation of the 2-nd cyclic shift (2, 1, 3) also equals to 2, so the optimal are both 1-st and 2-nd cyclic shifts.
import java.io.*;
import java.util.*;

public final class Solution {

    public static void main(String[] args) {
        
        Solution s=new Solution();
        s.solve();
        
    }
    
    PrintWriter pw=new PrintWriter(System.out);
    I r=new I();
    
    int gr[]=new int[2000000];
    
    void solve(){
        int n,i,j,k,l;
	    long m=0,dec=0,inc=0,init=0;
        n=r.in_i();
        int p[]=new int[n+1];
        for(i=1;i<=n;i++){
            p[i]=r.in_i();
            init += Math.abs(p[i]-i);
		if(p[i] > i){
			dec++;
			gr[p[i]-i]++;
		   }
		else
			inc++;
            //pw.println(p[i]);
	      }
	l=0;
	m = init; 
	inc--;
	for(k=1; k<n; k++)
	{		// perform shifts with id k

		init += inc-dec;
 	    init += Math.abs(p[n-k+1]-1)-Math.abs(p[n-k+1]-n);
		if(init < m){
			m=init;
			l=k;
		}		
		
		gr[p[n-k+1]-1+k]++;
		dec++;
		dec -= gr[k];
		inc--;
		inc += gr[k];
        
        
    }
        pw.print(m+" "+l);
        pw.close();
    }
    static class I{
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        
        public I() {
                this.stream = System.in;
        }
        
        public int read() {
                if (numChars == -1) {
                        throw new InputMismatchException();
                }
                if (curChar >= numChars) {
                        curChar = 0;
                        try {
                                numChars = stream.read(buf);
                        } catch (IOException e) {
                                throw new InputMismatchException();
                        }
                        if (numChars <= 0) {
                                return -1;
                        }
                }
                return buf[curChar++];
        }
        
        public int in_i() {
                int c = read();
                while (isSpaceChar(c)) {
                        c = read();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = read();
                }
                int res = 0;
                do {
                        if (c < '0' || c > '9') {
                                throw new InputMismatchException();
                        }
                        res *= 10;
                        res += c - '0';
                        c = read();
                } while (!isSpaceChar(c));
                return res * sgn;
        }
        
        public String readString() {
                int c = read();
                while (isSpaceChar(c)) {
                        c = read();
                }
                StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                        c = read();
                } while (!isSpaceChar(c));
                return res.toString();
        }
        
        public double in_d() {
                int c = read();
                while (isSpaceChar(c)) {
                        c = read();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                        if (c == 'e' || c == 'E') {
                                return res * Math.pow(10, in_i());
                        }
                        if (c < '0' || c > '9') {
                                throw new InputMismatchException();
                        }
                        res *= 10;
                        res += c - '0';
                        c = read();
                }
                if (c == '.') {
                        c = read();
                        double m = 1;
                        while (!isSpaceChar(c)) {
                                if (c == 'e' || c == 'E') {
                                        return res * Math.pow(10, in_i());
                                }
                                if (c < '0' || c > '9') {
                                        throw new InputMismatchException();
                                }
                                m /= 10;
                                res += (c - '0') * m;
                                c = read();
                        }
                }
                return res * sgn;
        }
        
        public long in_l() {
                int c = read();
                while (isSpaceChar(c)) {
                        c = read();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = read();
                }
                long res = 0;
                do {
                        if (c < '0' || c > '9') {
                                throw new InputMismatchException();
                        }
                        res *= 10;
                        res += c - '0';
                        c = read();
                } while (!isSpaceChar(c));
                return res * sgn;
        }
        
        public boolean isSpaceChar(int c) {
                if (filter != null) {
                        return filter.isSpaceChar(c);
                }
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
        
        public String next() {
                return readString();
        }
        
        public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
        }
}

}