#include <bits/stdc++.h>
using namespace std;
int ara[400005];
int pri[400005];
int lft[400005];
int rht[400005];
struct segTree {
  int n;
  vector<int> tree, lazy;
  segTree(int n) : n(n), tree(4 * n, 0), lazy(4 * n, 0) {}
  void propagate(int node, int l, int r) {
    tree[node] += lazy[node];
    if (l != r) lazy[2 * node] += lazy[node], lazy[2 * node + 1] += lazy[node];
    lazy[node] = 0;
  }
  void treeUpdate(int node, int l, int r, int u, int v, int val) {
    int mid = (l + r) >> 1;
    propagate(node, l, r);
    if (l > v || r < u) return;
    if (l >= u && r <= v) {
      lazy[node] += val;
      propagate(node, l, r);
      return;
    }
    treeUpdate(2 * node, l, mid, u, v, val);
    treeUpdate(2 * node + 1, mid + 1, r, u, v, val);
    tree[node] = max(tree[2 * node], tree[2 * node + 1]);
  }
  void update(int l, int r, int val) {
    if (l > r) return;
    treeUpdate(1, 1, n, l, r, val);
  }
  int treeQuery(int node, int l, int r, int u, int v) {
    int mid = (l + r) >> 1;
    propagate(node, l, r);
    if (l > v || r < u) return 0;
    if (l >= u && r <= v) return tree[node];
    return max(treeQuery(2 * node, l, mid, u, v),
               treeQuery(2 * node + 1, mid + 1, r, u, v));
  }
  int query(int l, int r) { return treeQuery(1, 1, n, l, r); }
};
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", ara + i);
  for (int i = 1; i <= n; i++) pri[ara[i]] = i;
  for (int i = 1; i <= n; i++) ara[i + n] = ara[i];
  stack<int> st;
  st.push(0);
  for (int i = 1; i <= 2 * n; i++) {
    while (ara[st.top()] > ara[i]) st.pop();
    lft[i] = st.top();
    st.push(i);
  }
  while (st.size()) st.pop();
  st.push(2 * n + 1);
  for (int i = 2 * n; i; i--) {
    while (ara[st.top()] > ara[i]) st.pop();
    rht[i] = st.top();
    st.push(i);
  }
  segTree tree(2 * n);
  for (int i = 1; i <= n; i++) {
    int j = pri[i];
    int idx = lft[j];
    if (rht[j] <= n && ara[rht[j]] > ara[idx]) idx = rht[j];
    int x = tree.query(idx, idx);
    tree.update(j, j, x + 1);
  }
  int ans = tree.query(1, n);
  int ansi = 0;
  for (int i = 2; i <= n; i++) {
    int y = tree.query(i - 1, i - 1);
    tree.update(i - 1, i - 1, -y);
    int j = rht[i - 1];
    tree.update(i, j - 1, -1);
    j = lft[i + n - 1];
    tree.update(j + 1, i + n - 2, 1);
    int x = tree.query(j, j);
    tree.update(i + n - 1, i + n - 1, x + 1);
    int tmp = tree.query(i, i + n - 1);
    if (tmp < ans) ans = tmp, ansi = i - 1;
  }
  printf("%d %d\n", ans, ansi);
  return 0;
}
