#include <bits/stdc++.h>
using namespace std;
int n, arr[1000009];
int main() {
  scanf("%d", &n);
  priority_queue<int> q;
  long long x = 0, ans;
  for (int f = 0; f < n; f++) {
    scanf("%d", &arr[f]);
    if (f + 1 < arr[f]) q.push(-arr[f] + f + 1);
    x += abs(arr[f] - f - 1);
  }
  ans = x;
  int ans1 = 0;
  for (int f = 1; f < n; f++) {
    x -= q.size();
    x += n - q.size() - 1;
    x -= abs(arr[n - f] - n);
    x += abs(arr[n - f] - 1);
    if (x < ans) ans = x, ans1 = f;
    while (q.size() && -q.top() <= f) {
      q.pop();
    }
    if (arr[n - f] + f - 1 > f) q.push(-arr[n - f] - f + 1);
  }
  cout << ans << " " << ans1 << endl;
}
