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.
#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1e6 + 9;
const long long int inf = 0x3f3f3f3f;
long long int a[maxn];
long long int sum[maxn << 2];
long long int fl[maxn << 2];
long long int zz[maxn];
void build(long long int l, long long int r, long long int root) {
  for (int i = 1; i <= r; i++) {
    zz[i] = 0;
  }
  return;
  fl[root] = 0;
  sum[root] = 0;
  if (l == r) return;
  long long int mid = l + r >> 1;
  build(l, mid, root << 1);
  build(mid + 1, r, root << 1 | 1);
}
long long int ql, qr;
void update(long long int l, long long int r, long long int root,
            long long int c) {
  if (ql > qr) return;
  zz[ql] += c;
  zz[qr + 1] -= c;
  return;
  if (ql <= l && r <= qr) {
    fl[root] += c;
    sum[root] += c * (r - l + 1);
    return;
  }
  long long int mid = l + r >> 1;
  if (ql <= mid) update(l, mid, root << 1, c);
  if (qr > mid) update(mid + 1, r, root << 1 | 1, c);
}
long long int query(long long int l, long long int r, long long int root) {
  if (ql <= l && r <= qr) {
    return sum[root];
  }
  long long int mid = l + r >> 1;
  if (ql <= mid)
    return fl[root] + query(l, mid, root << 1);
  else
    return fl[root] + query(mid + 1, r, root << 1 | 1);
}
int main() {
  long long int n;
  scanf("%lld", &n);
  for (long long int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  build(1, n, 1);
  long long int ans = 0;
  long long int minans = inf;
  long long int shif = 0;
  for (long long int i = 1; i <= n; i++) {
    ans += abs(a[i] - i);
    if (a[i] >= i) {
      ql = 1;
      qr = a[i] - i;
      update(1, n, 1, -1);
      ql = qr + 1;
      qr = n - i;
      update(1, n, 1, 1);
      ql = qr = n - i + 1;
      update(1, n, 1, a[i] * 2 - n - 1);
      ql++;
      qr = n - 1;
      update(1, n, 1, -1);
    } else {
      ql = 1;
      qr = n - i;
      update(1, n, 1, 1);
      ql = ++qr;
      update(1, n, 1, a[i] * 2 - n - 1);
      ql++;
      qr += a[i] - 1;
      update(1, n, 1, -1);
      ql = qr + 1;
      qr = n - 1;
      update(1, n, 1, 1);
    }
  }
  minans = ans;
  shif = 0;
  long long int c = 0;
  for (long long int i = 1; i < n; i++) {
    ql = qr = i;
    c = c + zz[i];
    ans += c;
    if (ans < minans) {
      minans = ans;
      shif = i;
    }
  }
  printf("%lld %lld\n", minans, shif);
  return 0;
}
