#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
long long p[maxn], h[maxn << 1];
long long n, d, x, eq, ans, k;
int main() {
  scanf("%lld", &n);
  for (long long i = 1LL; i <= n; ++i) {
    scanf("%lld", &p[i]);
    if (p[i] > i)
      d++, h[p[i] - i]++;
    else if (p[i] == i)
      eq++, h[0]++;
    else
      x++;
    ans += abs(p[i] - i);
  }
  long long tmp = ans;
  for (long long last = n - 1LL, now = 1LL; last >= 1LL; last--, now++) {
    tmp += (eq + x);
    tmp -= d;
    d -= h[now];
    if (p[last + 1] >= last + 1) h[p[last + 1] - (last + 1)]--;
    h[p[last + 1] - 1 + now]++;
    eq = h[now];
    if (p[last + 1] > 1LL) d++;
    x = n - eq - d;
    tmp -= abs(p[last + 1] - n - 1LL);
    tmp += abs(p[last + 1] - 1LL);
    if (tmp < ans) ans = tmp, k = now;
  }
  printf("%lld %lld\n", ans, k);
  return 0;
}
