#include <bits/stdc++.h>
inline void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  x *= f;
}
int n, p[1000005], a[1000005], num, l, r;
long long ans, sum;
int main() {
  read(n);
  for (register int i = 1; i <= n; ++i) {
    read(p[i]);
    if (p[i] >= i)
      ++l, ++a[p[i] - i];
    else
      ++r;
    sum += abs(p[i] - i);
  }
  ans = sum, num = 0;
  for (register int i = 1; i <= n; ++i) {
    l -= a[i - 1], r += a[i - 1];
    sum += -l + r - (n + 1 - p[n - i + 1]) + (p[n - i + 1] - 1);
    ++a[(p[n - i + 1] + i - 1) % n];
    ++l, --r;
    if (sum < ans) ans = sum, num = i;
  }
  printf("%lld %d\n", ans, num);
  return 0;
}
