#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct node {
  int dep, h, p;
};
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<int> perm(n);
  for (int& x : perm) cin >> x;
  int off = find(begin(perm), end(perm), 1) - begin(perm);
  rotate(begin(perm), begin(perm) + off, end(perm));
  perm.push_back(1);
  vector<int> rans(n + 1);
  rans[0] = 1;
  vector<node> rtree(n + 1);
  rtree[1].dep = 1;
  for (int i = 1; i < n; i++) {
    int h = 0;
    int p = perm[i - 1];
    int v = perm[i];
    while (v < p) {
      h = max(rtree[p].h, h) + 1;
      p = rtree[p].p;
    }
    int d = rtree[p].dep + 1;
    rtree[v] = {d, h, p};
    rans[i] = max(d + h, rans[i - 1]);
  }
  vector<int> lans(n + 1);
  lans[0] = 1;
  vector<node> ltree(n + 1);
  ltree[1].dep = 1;
  for (int i = 1; i < n; i++) {
    int h = 0;
    int p = perm[n - i + 1];
    int v = perm[n - i];
    while (v < p) {
      h = max(ltree[p].h, h) + 1;
      p = ltree[p].p;
    }
    int d = ltree[p].dep + 1;
    ltree[v] = {d, h, p};
    lans[i] = max(d + h, lans[i - 1]);
  }
  pair<int, int> best = {n, 0};
  for (int i = 0; i < n; i++) {
    pair<int, int> alt = {max(lans[i], rans[n - 1 - i]), i};
    best = min(best, alt);
  }
  cout << best.first << ' ' << (n + off - best.second) % n << '\n';
}
