#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> nv;
long long dirn;
long long calc(const vector<long long> &v) {
  map<long long, long long> depth;
  vector<long long> idx(n + 1);
  for (long long i = 0; i < n; i++) {
    idx[v[i]] = i;
  }
  long long l = 1, r = 1;
  depth[idx[1]] = 1;
  for (long long i = 2; i <= n; i++) {
    long long val = 0;
    auto it = depth.upper_bound(idx[i]);
    if (it != depth.end()) val = max(val, it->second);
    if (it != depth.begin()) {
      --it;
      val = max(val, it->second);
    }
    depth[idx[i]] = val + 1;
    if (idx[i] > idx[1])
      r = max(r, val + 1);
    else
      l = max(l, val + 1);
  }
  dirn = l - r;
  return max(l, r);
}
vector<long long> newvec(const vector<long long> &v, long long mid) {
  for (long long i = mid; i < n; i++) nv[i - mid] = v[i];
  for (long long i = 0; i < mid; i++) nv[(n - mid) + i] = v[i];
  return nv;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  vector<long long> v(n);
  nv.resize(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long shft = 0;
  for (long long i = 0; i < n; i++) {
    if (v[i] == 1) {
      v = newvec(v, i + 1);
      shft = i + 1;
      break;
    }
  }
  long long st = 0, en = n - 1;
  while (en - st > 1) {
    long long mid = (st + en) / 2;
    long long a = calc(newvec(v, mid));
    if (dirn > 0)
      st = mid;
    else
      en = mid;
  }
  long long mina = n, minidx = (st + shft) % n;
  for (long long i = st; i <= en; i++) {
    long long val = calc(newvec(v, i));
    if (val < mina) {
      minidx = (i + shft) % n;
      mina = val;
    }
  }
  cout << mina << " " << minidx;
  return 0;
}
