#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
long long diff[maxn << 1], p[maxn];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long cnt = 0;
  for (long long i = 1; i <= n; ++i) {
    cin >> p[i];
    if (p[i] > i)
      ++diff[p[i] - i];
    else
      ++cnt;
  }
  long long cur = 0;
  for (long long i = 1; i <= n; ++i) cur += abs(p[i] - i);
  long long ans = cur;
  long long tans = 0;
  for (long long i = 1; i < n; ++i) {
    long long ind = (n - i + 1) % n;
    if (ind == 0) ind = n;
    --cnt;
    cur -= abs(p[ind] - n);
    cur += abs(p[ind] - 1);
    if (p[ind] > n + i - 1) --diff[p[ind] - (n + i - 1)];
    ++diff[p[ind] - 1 + i];
    cur += cnt;
    cur -= (n - cnt - 1);
    cnt += diff[i];
    if (cur < ans) {
      ans = cur;
      tans = i;
    }
  }
  cout << ans << ' ' << tans << endl;
  return 0;
}
