#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 1e6 + 100;
int a[N], shift[N];
int main() {
  int n, lower = 0;
  long long sum = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (a[i] > i) {
      shift[a[i] - i]++;
      lower++;
    }
    sum += abs(a[i] - i);
  }
  long long mmin = sum, mark = 0;
  for (int i = 1; i < n; i++) {
    int x = a[n - i + 1];
    sum += (n - lower - 1) - lower + abs(x - 1) - abs(x - n);
    lower -= shift[i];
    if (x > 1) {
      lower++;
      shift[(x - 1 + i) % n]++;
      assert((a[n - i + 1] - 1 + i) % n ==
             (a[n - i + 1] + n - (n - i + 1)) % n);
    }
    if (sum < mmin) {
      mmin = sum;
      mark = i;
    }
  }
  printf("%lld %lld\n", mmin, mark);
  return 0;
}
