#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int cnt_neg = 0, cnt_pos = 0;
int arr[maxn << 1];
vector<int> faster[maxn];
bool out[maxn << 1];
int main() {
  int n;
  scanf("%d", &n);
  for (int e = 1; e <= n; e++) scanf("%d", arr + e), arr[e + n] = arr[e];
  int hi = 2 * n, lo = n + 1, nowlo = n;
  long long sum = 0;
  for (int cur = hi; cur >= lo; cur--) {
    if (arr[cur] <= nowlo)
      cnt_pos++;
    else
      cnt_neg++, faster[arr[cur] - nowlo].push_back(cur);
    sum += abs(arr[cur] - nowlo);
    nowlo--;
  }
  long long ans = sum, shift = 0, state = 0;
  for (; lo > 1;) {
    if (arr[hi] <= n)
      cnt_pos--;
    else
      cnt_neg--;
    sum -= abs(arr[hi] - n);
    out[hi] = 1;
    shift++;
    sum += -cnt_neg + cnt_pos;
    sum += abs(arr[lo - 1] - 1);
    if (sum < ans) ans = sum, state = shift;
    if (arr[lo - 1] > 1) {
      cnt_neg++;
      if (shift + arr[lo - 1] - 1 < n)
        faster[shift + arr[lo - 1] - 1].push_back(lo - 1);
    } else
      cnt_pos++;
    while (!faster[shift].empty()) {
      if (!out[faster[shift].back()]) cnt_neg--, cnt_pos++;
      faster[shift].pop_back();
    }
    lo--;
    hi--;
  }
  printf("%lld %lld\n", ans, state);
  return 0;
}
