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>
const double PI = acos(-1.0);
using namespace std;
long long bigmod(long long b, long long p, long long m) {
  if (p == 0) return 1;
  long long my = bigmod(b, p / 2, m);
  my *= my;
  my %= m;
  if (p & 1) my *= b, my %= m;
  return my;
}
int setb(int n, int pos) { return n = n | (1 << pos); }
int resb(int n, int pos) { return n = n & ~(1 << pos); }
bool checkb(int n, int pos) { return (bool)(n & (1 << pos)); }
long long ara[1000005], n;
vector<long long> exact[1000005];
long long pos, neg, posval, negval;
void prework() {
  long long i;
  for (i = 1; i <= n; i++) {
    long long d = ara[i] - i;
    if (d >= 0)
      exact[d].push_back(i), posval += d, pos++;
    else
      exact[n + d].push_back(i), negval += (-d), neg++;
  }
}
void U(long long shift) {
  long long len = exact[shift - 1].size(), i;
  bool shit_just_happened = 0;
  for (i = 0; i < len; i++) {
    long long id = exact[shift - 1][i];
    if (n - shift + 1 == id) {
      shit_just_happened = 1;
      pos--;
    } else {
      neg++;
      pos--;
    }
  }
  posval -= pos;
  if (shit_just_happened) {
    pos++;
    long long id = n - shift + 1;
    posval += (ara[id] - 1);
    negval += neg;
  } else {
    long long id = n - shift + 1;
    long long diff = n - ara[id];
    neg--;
    negval -= diff;
    negval += neg;
    pos++;
    long long d = ara[id] - 1;
    posval += d;
  }
}
long long bra[1000005];
long long bruteforce() {
  long long i, j;
  for (i = 1; i <= n; i++) bra[i] = ara[i];
  long long ret = INT_MAX;
  for (i = 0; i < n; i++) {
    long long tot = 0;
    for (j = 1; j <= n; j++) {
      long long newpos = j + i;
      if (newpos > n) newpos -= n;
      long long d = llabs(ara[j] - newpos);
      tot += d;
    }
    ret = min(ret, tot);
  }
  return ret;
}
int main() {
  long long i;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &ara[i]);
  prework();
  long long ret = posval + negval;
  long long id = 0;
  for (i = 1; i <= n - 1; i++) {
    U(i);
    long long my = posval + negval;
    ret = min(ret, my);
    if (my == ret) id = i;
  }
  printf("%lld %lld\n", ret, id);
  return 0;
}
