#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e6 + 9, maxV = 20, MOD = 1e9 + 7, LG = 11, BASE = 29;
int n, arr[maxN];
long long dp[maxN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    arr[i]--;
  }
  priority_queue<int, vector<int>, greater<int>> pq;
  long long rela = n, tot = 0, investors = 0;
  for (int i = 0; i < n; i++) {
    if (i - arr[i] <= 0) {
      investors++;
    } else {
      pq.push(i - arr[i] + (int)rela);
    }
    tot += abs(i - arr[i]);
  }
  dp[0] = tot;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    rela++;
    investors--;
    dp[i] = dp[i - 1] + investors - pq.size() - arr[i - 1];
    while (pq.size() && pq.top() == rela) {
      investors++;
      pq.pop();
    }
    if (arr[i - 1] < n - 1) {
      dp[i] += n - 1 - arr[i - 1];
      pq.push(n - 1 - arr[i - 1] + (int)rela);
    } else
      investors++;
    if (dp[ans] > dp[i]) ans = i;
  }
  cout << dp[ans] << ' ' << (n - ans) % n << '\n';
}
