4
1 2 4 3
 4
2 1 4 3
 10
1 2 10 9 7 4 8 3 6 5
 10
1 7 10 6 5 2 3 8 9 4
 4
4 3 2 1
 4
2 1 3 4
 10
1 10 9 5 3 2 4 7 8 6
 4
2 3 1 4
 4
2 4 3 1
 10
1 5 10 8 4 3 9 2 7 6
 4
1 4 3 2
 10
1 8 10 6 2 4 9 3 7 5
 4
2 3 4 1
 10
2 6 10 1 9 7 4 8 5 3
 4
4 1 2 3
 10
1 9 10 5 6 7 3 8 4 2
 4
4 2 1 3
 4
3 1 4 2
 10
1 2 3 4 6 5 7 9 10 8
 4
4 3 1 2
 4
1 3 4 2
 10
2 5 10 3 6 4 9 1 8 7
 10
2 1 10 5 8 4 9 3 7 6
 4
3 1 2 4
 10
1 6 10 7 9 5 3 8 4 2
 2
1 2
 10
1 3 10 9 4 7 5 8 6 2
 4
1 3 2 4
 4
4 2 3 1
 4
3 2 1 4
 4
3 2 4 1
 4
1 2 3 4
 10
2 7 10 1 6 3 4 8 9 5
 2
2 1
 4
3 4 2 1
 4
3 4 1 2
 10
10 1 9 2 8 3 7 4 6 5
 10
1 4 10 8 9 2 3 6 7 5
 10
2 3 10 5 4 8 6 9 7 1
 108
1 102 33 99 6 83 4 20 61 100 76 71 44 9 24 87 57 2 81 82 90 85 12 30 66 53 47 36 43 29 31 64 96 84 77 23 93 78 58 68 42 55 13 70 62 19 92 14 10 65 63 75 91 48 11 105 37 50 32 94 18 26 52 89 104 106 86 97 80 95 17 72 40 22 79 103 25 101 35 51 15 98 67 5 34 69 54 27 45 88 56 16 46 60 74 108 21 41 73 39 107 59 3 8 28 49 7 38
 4
4 1 3 2
 4
2 4 1 3
 10
2 4 10 3 9 1 5 7 8 6
 4
1 4 2 3

2 0
 4 0
 26 5
 26 6
 4 1
 2 0
 20 7
 4 0
 2 1
 26 6
 4 0
 24 6
 0 1
 28 1
 0 3
 26 1
 2 3
 4 1
 6 0
 2 2
 2 1
 28 0
 28 0
 2 3
 24 4
 0 0
 22 1
 2 0
 4 1
 4 0
 2 1
 0 0
 20 7
 0 1
 2 2
 0 2
 24 7
 20 5
 14 1
 3428 30
 2 3
 2 2
 28 0
 4 0

#include <bits/stdc++.h>
using namespace std;
inline long long input() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
const long long maxn = 2e6 + 1000;
const long long mod = 1e9 + 7;
struct old {
  long long sum_[maxn], a[maxn];
  long long cnt[maxn], add[maxn];
  long long Q = 0;
  long long L[maxn], R[maxn];
  inline long long Sum(long long n) { return (n * (n + 1) / 2); }
  inline long long ok(long long x) { return x; }
  inline long long answer(long long l, long long r) {
    long long res = ok(sum_[r] - (l ? sum_[l - 1] : 0));
    for (long long pt = 0; pt < Q; pt++) {
      pair<long long, long long> eshterak = {max(l, L[pt]), min(r, R[pt])};
      if (eshterak.first > eshterak.second) continue;
      long long sz = eshterak.second - eshterak.first + 1;
      long long start = eshterak.first - L[pt] + 1;
      res = ok(ok(Sum(start + sz - 1) - Sum(start - 1)) + res);
    }
    return res;
  }
  inline void clear() {
    for (long long i = 1; i < maxn; i++) {
      cnt[i] = ok(cnt[i] + cnt[i - 1]);
      add[i] = ok(add[i] + add[i - 1] + cnt[i - 1]);
    }
    memset(cnt, 0, sizeof cnt);
    for (long long i = 0; i < maxn; i++) {
      add[i] = ok(add[i] + (i ? add[i - 1] : 0));
      sum_[i] = ok(sum_[i] + add[i]);
    }
    memset(add, 0, sizeof add);
    Q = 0;
  }
  long long shit(char tp, long long l = -1, long long r = -1) {
    if (tp == 'A')
      return answer(l, r);
    else {
      cnt[l] = ok(cnt[l] + 1);
      add[l] = ok(1 + add[l]);
      cnt[r + 1] = ok(cnt[r + 1] - 1);
      add[r + 1] = ok(add[r + 1] - (r - l + 2));
      L[Q] = l, R[Q] = r;
      Q++;
      return 0;
    }
  }
  old() {
    for (long long i = 0; i < maxn; i++) {
      sum_[i] = a[i] = cnt[i] = add[i] = L[i] = R[i] = 0;
    }
  }
} pos, neg;
long long a[maxn], n, dp[maxn];
inline long long reverse(long long x) { return n - x - 1; }
inline void dj() {
  for (long long i = 1; i < n; i++) dp[i] += dp[i - 1];
}
inline void add_seg(long long from, long long to, long long val) {
  dp[from] += val;
  dp[to + 1] -= val;
}
int32_t main() {
  n = input();
  for (long long i = 0; i < n; i++) a[i] = input();
  for (long long i = 0; i < n; i++) {
    long long L = i - a[i] + 1;
    if (L >= 0) {
      long long from = reverse(i), to = reverse(L);
      add_seg(from, to, a[i]);
      neg.shit('Q', from, to);
      if (L > 0) {
        from = reverse(L - 1), to = reverse(0);
        pos.shit('Q', from, to);
      }
      if (i == n - 1) continue;
      from = reverse(n - 1), to = reverse(i + 1);
      pos.shit('Q', from, to);
      add_seg(from, to, L);
    } else {
      long long from = reverse(n - 1), to = reverse(n + L);
      add_seg(from, to, a[i]);
      neg.shit('Q', from, to);
      add_seg(from, to, -(i + 1));
      from = reverse(i), to = reverse(0);
      add_seg(from, to, a[i]);
      neg.shit('Q', from, to);
      from = reverse(n + L - 1), to = reverse(i + 1);
      if (from > to) continue;
      pos.shit('Q', from, to);
    }
  }
  dj();
  pos.clear();
  neg.clear();
  long long id, res = 1e18;
  for (long long i = 0; i < n; i++) {
    long long value = pos.shit('A', n - i - 1, n - i - 1) -
                      neg.shit('A', n - i - 1, n - i - 1) + dp[n - i - 1];
    if (value < res) res = value, id = (n - i) % n;
  }
  cout << res << " " << id << endl;
}
