#include <bits/stdc++.h>
using namespace std;
long long n, sum, ans, anss, l;
long long a[2000001], p[2000001];
int main() {
  scanf("%I64d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    if (a[i] > i) {
      l++;
      p[a[i] - i]++;
    }
    sum += abs(a[i] - i);
  }
  ans = sum;
  anss = 0;
  for (int i = 1; i < n; i++) {
    int x = a[n - i + 1];
    sum -= l;
    sum += n - l - 1;
    sum += abs(x - 1) - abs(x - n);
    l -= p[i];
    if (x != 1) {
      l++;
      p[(x - 1 + i) % n]++;
    }
    if (sum < ans) ans = sum, anss = i;
  }
  printf("%I64d %I64d", ans, anss);
  return 0;
}
