#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000001;
int p[maxN], a[maxN];
int main() {
  int n, x = 0;
  scanf("%d", &n);
  long long dev = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", p + i);
    int d = abs(p[i] - i);
    dev += d;
    if (i <= p[i])
      a[d]++, x++;
    else
      a[n - d]++;
  }
  long long res = 1LL * n * n;
  int k;
  for (int i = 0; i < n; i++) {
    if (dev < res) {
      res = dev;
      k = i;
    }
    x -= a[i] - 1;
    dev += (p[n - i] - x) * 2;
  }
  printf("%lld %d\n", res, k);
  return 0;
}
