#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5 + 2;
int dep_tree[MAXN * 4];
int add_down[MAXN * 4];
void push(int v) {
  dep_tree[v] += add_down[v];
  if (v * 2 < MAXN * 4) {
    add_down[v * 2] += add_down[v];
    add_down[v * 2 + 1] += add_down[v];
  }
  add_down[v] = 0;
}
void add_val(int v, int l, int r, int ql, int qr, int val) {
  if (l >= qr || r <= ql) return;
  push(v);
  if (ql <= l && qr >= r) {
    add_down[v] += val;
    push(v);
    return;
  }
  int m = (l + r) / 2;
  add_val(v * 2, l, m, ql, qr, val);
  add_val(v * 2 + 1, m, r, ql, qr, val);
  dep_tree[v] = max(dep_tree[v * 2], dep_tree[v * 2 + 1]);
}
int get_max(int v, int l, int r, int ql, int qr) {
  if (l >= qr || r <= ql) {
    return 0;
  }
  push(v);
  if (ql <= l && qr >= r) {
    return dep_tree[v];
  }
  int m = (l + r) / 2;
  auto left = get_max(v * 2, l, m, ql, qr);
  auto right = get_max(v * 2 + 1, m, r, ql, qr);
  return max(left, right);
}
struct node {
  int prior, ind;
  node *left = nullptr;
  node *right = nullptr;
  node *par = nullptr;
  node(int prior, int ind) {
    this->prior = prior;
    this->ind = ind;
  }
  int get_dep() { return get_max(1, 0, MAXN, this->ind, this->ind + 1); }
};
void set_right(node *par, node *ch) {
  if (par) par->right = ch;
  if (ch) ch->par = par;
}
void set_left(node *par, node *ch) {
  if (par) par->left = ch;
  if (ch) ch->par = par;
}
node *add_back(node *n, node *root, node *new_node, int start) {
  if (!n) return new_node;
  if (n->prior < new_node->prior) {
    set_right(n, new_node);
    int dep = n->get_dep() + 1;
    add_val(1, 0, MAXN, new_node->ind, new_node->ind + 1, dep);
    return root;
  }
  while (n->par && n->par->prior > new_node->prior) n = n->par;
  int from = start;
  if (!n->par) {
    root = new_node;
  } else {
    set_right(n->par, new_node);
    int dep = n->get_dep();
    add_val(1, 0, MAXN, new_node->ind, new_node->ind + 1, dep);
    from = n->par->ind + 1;
  }
  set_left(new_node, n);
  add_val(1, 0, MAXN, from, new_node->ind, 1);
  return root;
}
node *remove_front(node *n, node *root, int fin) {
  if (n == root) {
    add_val(1, 0, MAXN, 0, fin, -1);
    n->right->par = nullptr;
    return n->right;
  }
  set_left(n->par, n->right);
  add_val(1, 0, MAXN, n->ind, n->par->ind, -1);
  return root;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<node *> nodes(n);
  node *root = nullptr, *last = nullptr;
  for (int i = 0; i < n; i++) {
    nodes[i] = new node(a[i], i);
    root = add_back(last, root, nodes[i], 0);
    last = nodes[i];
  }
  int min_dep = get_max(1, 0, MAXN, 0, n), shift = 0;
  for (int i = 0; i < n - 1; i++) {
    root = remove_front(nodes[i], root, n + i);
    nodes[i]->ind = n + i;
    nodes[i]->left = nodes[i]->right = nodes[i]->par = nullptr;
    root = add_back(last, root, nodes[i], i + 1);
    last = nodes[i];
    int dep = get_max(1, 0, MAXN, i + 1, i + n + 1);
    if (dep < min_dep) {
      min_dep = dep;
      shift = i + 1;
    }
  }
  cout << min_dep + 1 << ' ' << shift << endl;
}
