#include <bits/stdc++.h>
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 1000000007;
const ll root = 62;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
ll binpow(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
ll modInv(ll a) { return binpow(a, MOD - 2); }
const double PI = acos(-1);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxM = 262144;
const int mxN = 200001;
int sgmax[4 * mxM];
int del[4 * mxM];
int n;
int arr[2 * mxN];
int p[2 * mxN];
int to[2 * mxN];
int prv[2 * mxN];
void push(int i) {
  del[2 * i] += del[i];
  del[2 * i + 1] += del[i];
  del[i] = 0;
}
void resolve(int i) {
  sgmax[i] = max(sgmax[2 * i] + del[2 * i], sgmax[2 * i + 1] + del[2 * i + 1]);
}
void init(int i = 1, int l = 0, int r = 2 * n - 1) {
  del[i] = 0;
  if (l == r) {
    sgmax[i] = arr[l];
    return;
  }
  int mid = (l + r) >> 1;
  init(2 * i, l, mid);
  init(2 * i + 1, mid + 1, r);
  resolve(i);
}
void upd(int l, int r, int ch, int i = 1, int le = 0, int rr = 2 * n - 1) {
  if (r < l) {
    return;
  }
  r = min(r, 2 * n - 1);
  if (rr < l || le > r) {
    return;
  }
  if (le >= l && rr <= r) {
    del[i] += ch;
    return;
  }
  push(i);
  int mid = (le + rr) >> 1;
  upd(l, r, ch, 2 * i, le, mid);
  upd(l, r, ch, 2 * i + 1, mid + 1, rr);
  resolve(i);
}
int qmax(int l, int r, int i = 1, int le = 0, int rr = 2 * n - 1) {
  if (rr < l || le > r) return 0;
  if (le >= l && rr <= r) return sgmax[i] + del[i];
  push(i);
  resolve(i);
  int mid = (le + rr) >> 1;
  return max(qmax(l, r, 2 * i, le, mid), qmax(l, r, 2 * i + 1, mid + 1, rr));
}
vector<int> comp(int *p) {
  init();
  vector<int> res(n);
  vector<int> sv(n + 1);
  for (int i = (0); i < (n); ++i) {
    int tt = qmax(0, p[i] - 1);
    res[i] = sv[tt] + 1;
    upd(p[i], p[i], i + 1);
    sv[i + 1] = res[i];
  }
  return res;
}
int main() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin.tie(0)->sync_with_stdio(0);
  cin >> n;
  for (int i = (0); i < (n); ++i) {
    cin >> p[i];
    p[i + n] = p[i];
  }
  vector<int> left = comp(p);
  reverse(p, p + n);
  vector<int> right = comp(p);
  reverse(right.begin(), right.end());
  reverse(p, p + n);
  for (int i = (0); i < (n); ++i) {
    arr[i] = left[i] + right[i] - 1;
  }
  set<int> curr;
  for (int i = (0); i < (2 * n); ++i) {
    auto it = curr.lower_bound(p[i]);
    while (it != curr.end()) {
      to[*it] = i;
      it = curr.erase(it);
    }
    if (i < n) {
      curr.insert(p[i]);
    }
  }
  curr.clear();
  for (int i = (2 * n) - 1; i >= (0); --i) {
    auto it = curr.lower_bound(p[i]);
    while (it != curr.end()) {
      prv[*it] = i;
      it = curr.erase(it);
    }
    if (i >= n) {
      curr.insert(p[i]);
    }
  }
  init();
  pair<int, int> ans = {qmax(0, n - 1), 0};
  for (int i = (0); i < (n - 1); ++i) {
    upd(i, to[p[i]] - 1, -1);
    upd(i + n, i + n, qmax(prv[p[i]], prv[p[i]]));
    upd(prv[p[i]] + 1, i + n, 1);
    ans = min(ans, {qmax(i + 1, n + i), i + 1});
  }
  cout << ans.first << " " << ans.second << "\n";
  return 0;
}
