#include <bits/stdc++.h>
using namespace std;
long long dat[1000005];
struct node {
  long long val;
  node(long long a) { val = a; }
  bool operator<(const node& a) const { return val > a.val; }
};
int main() {
  int n, a;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &dat[i]);
    }
    long long ansSum = 99999999999999ll;
    long long tempSum = 0;
    int cnt = 0;
    priority_queue<node> q;
    for (int i = 1; i <= n; i++) {
      if (dat[i] > i) {
        q.push(dat[i] - i);
      } else
        cnt++;
      tempSum += abs(dat[i] - i);
    }
    int mov = 0;
    int ansmov = 0;
    for (int i = n; i > 0; i--) {
      if (tempSum < ansSum) {
        ansSum = tempSum;
        ansmov = mov;
      }
      tempSum += cnt - 1;
      tempSum -= q.size();
      tempSum += -(n - dat[i]) + (dat[i] - 1);
      mov++;
      if (dat[i] > 1) {
        q.push(dat[i] - 1 + mov);
        cnt--;
      }
      while (!q.empty() && q.top().val - mov <= 0) {
        q.pop();
        cnt++;
      }
    }
    printf("%lld %d\n", ansSum, ansmov);
  }
  return 0;
}
