#include <bits/stdc++.h>
using namespace std;
long long ans, now;
int n, m, l, r, last, id, a[4000005], t[4000005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    now += abs(a[i] - i);
    if (i == n) continue;
    if (i < a[i]) {
      t[a[i] - i]++;
      l++;
    } else
      r++;
  }
  ans = now;
  last = n;
  for (int i = 1; i < n; i++) {
    now = now - l + r - (n - a[last]) + a[last] - 1;
    if (now < ans) {
      ans = now;
      id = i;
    }
    r += t[i];
    l -= t[i];
    if (a[last] != 1) r--, l++;
    t[i + a[last] - 1]++;
    last--;
  }
  printf("%lld %d\n", ans, id);
  return 0;
}
