#include <bits/stdc++.h>
using namespace std;
const int N = 1E6 + 10;
int a[N], cou[N];
int main() {
  int n;
  cin >> n;
  long long sum = 0;
  int add = 0, sub = 0;
  for (int i = 1; i <= (n); ++i) {
    scanf("%d", &a[i]);
    sum += abs(a[i] - i);
    cou[(a[i] - i + n) % n]++;
    if (i == n) break;
    if (a[i] > i)
      sub++;
    else
      add++;
  }
  long long res = sum;
  int resk = 0;
  for (int i = 1; i <= (n - 1); ++i) {
    sum += add - sub;
    int last = a[n - i + 1];
    sum += abs(last - 1) - abs(last - n);
    add = add + cou[i] - 1;
    sub = n - 1 - add;
    if (sum < res) res = sum, resk = i;
  }
  cout << res << ' ' << resk << endl;
  return 0;
}
