#include <bits/stdc++.h>
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-6;
inline long long nextint() {
  int sign = 1;
  char c = getchar();
  long long x = 0;
  while (c > '9' || c < '0') {
    if (c == '-') sign = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x *= sign;
}
using namespace std;
const int maxn = 1e6 + 10;
int p[maxn << 2];
int cnt[maxn << 1];
int main() {
  long long cur = 0;
  int pl = 0, pr = 0;
  int n = nextint();
  for (int i = 1; i <= n; ++i) {
    p[i] = nextint();
  }
  for (int i = 1; i <= n; ++i) {
    cur += abs(p[i] - i);
    if (p[i] >= i) {
      cnt[p[i] - i]++;
      ++pl;
    } else {
      ++pr;
    }
  }
  long long ans = cur;
  int k = 0;
  for (int i = 1; i < n; ++i) {
    pl -= cnt[i - 1];
    pr += cnt[i - 1];
    cur = cur - pl + pr - abs(p[n - i + 1] - (n + 1)) + p[n - i + 1] - 1;
    pl++, pr--;
    cnt[p[n - i + 1] + i - 1]++;
    if (ans > cur) ans = cur, k = i;
  }
  printf("%lld %d\n", ans, k);
}
