#include <bits/stdc++.h>
using namespace std;
int n;
long long s;
int n0, n1;
int x[1 << 20];
pair<long long, int> r;
int q[1 << 20];
int main() {
  scanf("%d", &n);
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    scanf("%d", x + i);
    x[i]--, s += abs(x[i] - i);
    if (i >= x[i])
      n0++;
    else
      n1++;
    q[(x[i] - i + n) % n]++;
  }
  r = make_pair(s, 0);
  for (int i = 1, ThxDem = n; i < ThxDem; ++i) {
    s += n0 - 1 - n1;
    s -= n - 1 - x[n - i];
    s += x[n - i];
    r = min(r, make_pair(s, i));
    n0--;
    n1++;
    n1 -= q[i];
    n0 += q[i];
  }
  printf("%lld %d\n", r.first, r.second);
  return 0;
}
