#include <bits/stdc++.h>
long long minimal_shift(int* array, int len) {
  int diviation_len = len * 2 - 1;
  int* diviation = (int*)calloc(diviation_len, sizeof(diviation[0]));
  int middle = diviation_len / 2;
  int up = 0;
  long long diff = 0;
  for (int i = 0; i < len; i++) {
    int index = array[i] - i - 1;
    if (index > 0) up++;
    diff += abs(index);
    diviation[middle + index] += 1;
  }
  int down = up;
  int equal = len - up - down;
  long long min_diff = diff;
  long long shift = 0;
  for (int i = 0; i < len - 1; i++) {
    diff -= up;
    diff += equal;
    diff += down;
    diff -= abs(array[len - i - 1] - len);
    diff += array[len - i - 1] - 1;
    int tmp = array[len - i - 1] - 1;
    if (middle + i + tmp + 1 < diviation_len) {
      diviation[middle + i + tmp + 1]++;
    }
    down += equal;
    equal = diviation[middle + i + 1];
    up -= equal;
    if (array[len - i - 1] == len) {
      down--;
      diff--;
      up++;
    } else {
      diff--;
      down--;
      up++;
    }
    if (min_diff > diff) {
      min_diff = diff;
      shift = i + 1;
    }
  }
  free(diviation);
  return shift;
}
int main(void) {
  int len;
  std::cin >> len;
  int* array = (int*)malloc(sizeof(array[0]) * len);
  for (int i = 0; i < len; i++) std::cin >> array[i];
  long long shift = minimal_shift(array, len);
  long long diff = 0;
  for (int i = 0; i < len; i++) diff += abs(array[i] - (i + shift) % len - 1);
  std::cout << diff << " " << shift << std::endl;
  free(array);
  return 0;
}
