#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int cnt[maxn];
int a[maxn], n;
int abs(int x) { return x > 0 ? x : -x; }
int main() {
  ios::sync_with_stdio(false);
  while (cin >> n) {
    int add = 0, sub = 0, b = 0;
    long long tmp = 0, res;
    memset(cnt, 0, sizeof(cnt));
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      tmp += abs(a[i] - i);
      cnt[(a[i] - i + n) % n]++;
      if (a[i] > i)
        sub++;
      else
        add++;
    }
    res = tmp;
    for (int i = 1; i < n; i++) {
      tmp += add - sub - 1;
      tmp += (a[n - i + 1] - 1) - (n - a[n - i + 1]);
      sub = sub - cnt[i] + 1;
      add = add + cnt[i] - 1;
      if (res > tmp) {
        res = tmp;
        b = i;
      }
    }
    cout << res << " " << b << endl;
  }
}
