#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
long long p[maxn], has[maxn << 1];
int main() {
  long long n, bigger = 0, smaller = 0, equ = 0, ans1 = 0, ans2 = 0;
  scanf("%lld", &n);
  for (long long i = 1ll; i <= n; i++) {
    scanf("%lld", &p[i]);
    if (p[i] > i)
      bigger++, has[p[i] - i]++;
    else if (p[i] == i)
      equ++, has[0]++;
    else
      smaller++;
    ans1 += abs(p[i] - i);
  }
  long long temp = ans1;
  for (long long last = n - 1ll, delta = 1ll; last >= 1ll; last--, delta++) {
    temp += equ + smaller - bigger;
    smaller += equ;
    bigger -= has[delta];
    if (p[last + 1] >= last + 1ll) has[p[last + 1] - last - 1]--;
    has[p[last + 1] - 1 + delta]++;
    equ = has[delta];
    if (p[last + 1] > 1ll) bigger++;
    smaller = n - equ - bigger;
    temp -= abs(p[last + 1] - n - 1ll) - abs(p[last + 1] - 1ll);
    if (temp < ans1) ans1 = temp, ans2 = delta;
  }
  printf("%lld %lld\n", ans1, ans2);
  return 0;
}
