#include <bits/stdc++.h>
const long long INF = 4e18L + 1;
const int IINF = 2e9 + 1;
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
const int N = 1e6;
int n;
int perm[N + 1];
vector<int> events0[N + 1];
int events1[N + 1];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  long long disc = 0;
  long long cnt_prev = 0, cnt_post = 0;
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    cin >> perm[i];
    disc += abs(i - perm[i]);
    events0[n + 1 - i].push_back(perm[i]);
    if (i < perm[i]) {
      events1[perm[i] - i]++;
      cnt_prev++;
    } else {
      events1[n - i + perm[i]]++;
      cnt_post++;
    }
  }
  long long res = disc, ans = 0;
  for (long long i = (long long)1; i < (long long)n; i++) {
    disc -= cnt_prev;
    disc += cnt_post;
    for (auto &p : events0[i]) {
      disc -= abs(p - (n + 1));
      disc += p - 1;
      cnt_post--;
      cnt_prev++;
    }
    cnt_prev -= events1[i];
    cnt_post += events1[i];
    if (disc < res) {
      res = disc;
      ans = i;
    }
  }
  cout << res << " " << ans << "\n";
  return 0;
}
