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 class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            String filename = "";
            if (filename.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(filename + ".in"));
                out = new PrintWriter(filename + ".out");
            }
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine(), " :");
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    class SegmentTree {
        long[] shiftValue;
        long[] defAdd;
        int[] progAdd;
        long[] res;
        int n;
        int size;

        SegmentTree(int n) {
            shiftValue = new long[4 * n];
            defAdd = new long[4 * n];
            progAdd = new int[4 * n];
            this.n = n;
            this.size = 4 * n;
            res = new long[n];
        }

        void push(int v, int tl, int tr) {
            if (v >= size) return;
            shiftValue[v] += defAdd[v];
            if ((v << 1) < size) {
                defAdd[v << 1] += defAdd[v];
                progAdd[v << 1] += progAdd[v];
            }
            int mid = (tl + tr) >> 1;
            if ((v << 1) + 1 < size) {
                defAdd[(v << 1) + 1] += defAdd[v] + progAdd[v] * (mid - tl + 1);
                progAdd[(v << 1) + 1] += progAdd[v];
            }
            defAdd[v] = 0;
            progAdd[v] = 0;
        }

        void pushAll() {
            pushAll(1, 0, n - 1);
        }

        void pushAll(int v, int tl, int tr) {
            push(v, tl, tr);
            if (tl == tr) {
                res[tl] = shiftValue[v];
                return;
            }
            int mid = (tl + tr) >> 1;
            pushAll(v << 1, tl, mid);
            pushAll((v << 1) + 1, mid + 1, tr);
        }

        void add(int v, int tl, int tr, int l, int r, long iniVal, int addFactor) {
            //push(v, tl, tr);
            if (tl == l && tr == r) {
                defAdd[v] += iniVal;
                progAdd[v] += addFactor;
                return;
            }

            int mid = (tl + tr) >> 1;
            if (r <= mid) {
                add(v << 1, tl, mid, l, r, iniVal, addFactor);
            } else if (l > mid) {
                add((v << 1) + 1, mid + 1, tr, l, r, iniVal, addFactor);
            } else {
                add((v << 1), tl, mid, l, mid, iniVal, addFactor);
                add((v << 1) + 1, mid + 1, tr, mid + 1, r, iniVal + addFactor * (long) (mid - l + 1), addFactor);
            }
        }

        void add(int l, int r, int i, int a) {
            if (l > r) return;
            add(1, 0, n - 1, l, r, i, a);
        }
    }

    void solve() throws IOException {
        int n = readInt();
        int[] a = readIntArray(n);
        solve(a);
//        while (true) {
//            int[] p = gen();
//            if (solve(p.clone()) != naive(p.clone())) {
//                throw new RuntimeException(Arrays.toString(p) + " " + solve(p.clone()) + " " + naive(p.clone()));
//            }
//        }
    }

    int[] gen() {
        Random random = new Random();
        int size = random.nextInt(10) + 1;
        int[] p = new int[size];
        for (int i = 0; i < size; i++) {
            p[i] = i + 1;
        }
        for (int i = 0; i < size; i++) {
            int ti = random.nextInt(i + 1);
            int t = p[ti];
            p[ti] = p[i];
            p[i] = t;
        }
        return p;
    }

    long solve(int[] p) {
        int n = p.length;
        int[] a = p;
        SegmentTree segmentTree = new SegmentTree(n);
        for (int i = 0; i < n; i++) {
            if (a[i] < i + 1) {
                int endShiftVal = n - 1 - i;
                segmentTree.add(0, endShiftVal, i - a[i] + 1, 1);
                int exactShift = n - 1 - i + a[i] - 1;
                segmentTree.add(endShiftVal + 1, exactShift, a[i] - 1, -1);
                segmentTree.add(exactShift + 2, n - 1, 1, 1);
            } else {
                int exactShiftVal = a[i] - i - 1;
                segmentTree.add(0, exactShiftVal, a[i] - 1 - i, -1);
                int endShiftVal = n - 1 - i;
                segmentTree.add(exactShiftVal + 1, endShiftVal, 1, 1);
                segmentTree.add(endShiftVal + 1, n - 1, a[i] - 1, -1);
            }
            //segmentTree.pushAll();
            //System.err.println(Arrays.toString(segmentTree.res));
        }

        segmentTree.pushAll();
        int minS = 0;
        for (int i = 0; i < n; i++) {
            if (segmentTree.res[i] < segmentTree.res[minS]) {
                minS = i;
            }
        }
        out.println(segmentTree.res[minS] + " " + minS);
        return segmentTree.res[minS];
    }

    int naive(int[] p) {
        int min = Integer.MAX_VALUE;
        for (int shift = 0; shift < p.length; shift++) {
            int[] s = shift(p, shift);
            int res = 0;
            for (int i = 0; i < p.length; i++) {
                res += Math.abs(s[i] - (i + 1));
            }
            min = Math.min(min, res);
        }
        return min;
    }

    int[] shift(int[] a, int s) {
        int[] res = new int[a.length];
        for (int i = 0; i < a.length; i++) {
            int ni = (i + s) % a.length;
            res[ni] = a[i];
        }
        return res;
    }

}