#include <bits/stdc++.h>
using namespace std;
long long seg_tree_f[400000 * 4 + 9];
long long lazy_f[400000 * 4 + 9];
void init_tree_f(int node, int beg, int end) {
  if (beg == end) {
    seg_tree_f[node] = 0;
    lazy_f[node] = 0;
    return;
  }
  int mid = (beg + end) >> 1;
  init_tree_f((node << 1), beg, mid);
  init_tree_f((node << 1) | 1, mid + 1, end);
  seg_tree_f[node] = 0;
  lazy_f[node] = 0;
}
inline void split_node_f(int node) {
  if (lazy_f[node] == 0) return;
  seg_tree_f[(node << 1)] += lazy_f[node];
  lazy_f[(node << 1)] += lazy_f[node];
  seg_tree_f[(node << 1) | 1] += lazy_f[node];
  lazy_f[(node << 1) | 1] += lazy_f[node];
  lazy_f[node] = 0;
}
inline void merge_node_f(int node) {
  seg_tree_f[node] = min(seg_tree_f[(node << 1)], seg_tree_f[(node << 1) | 1]);
}
void update_f(int node, int beg, int end, int i, int j, long long value) {
  if (beg > j || end < i) return;
  if (beg >= i && end <= j) {
    seg_tree_f[node] += value;
    lazy_f[node] += value;
    return;
  }
  split_node_f(node);
  int mid = (beg + end) >> 1;
  update_f((node << 1), beg, mid, i, j, value);
  update_f((node << 1) | 1, mid + 1, end, i, j, value);
  merge_node_f(node);
}
int query_f_leftmost(int node, int beg, int end, int i, int j,
                     long long target) {
  if (i > end || j < beg) return (1 << 30);
  if (seg_tree_f[node] > target) return (1 << 30);
  if (beg == end) return beg;
  split_node_f(node);
  int mid = (beg + end) >> 1;
  int ind = query_f_leftmost((node << 1), beg, mid, i, j, target);
  if (ind != (1 << 30)) return ind;
  return query_f_leftmost(((node << 1) | 1), mid + 1, end, i, j, target);
}
int query_f_rightmost(int node, int beg, int end, int i, int j,
                      long long target) {
  if (i > end || j < beg) return (-(1 << 30));
  if (seg_tree_f[node] > target) return (-(1 << 30));
  if (beg == end) return beg;
  split_node_f(node);
  int mid = (beg + end) >> 1;
  int ind = query_f_rightmost(((node << 1) | 1), mid + 1, end, i, j, target);
  if (ind != (-(1 << 30))) return ind;
  return query_f_rightmost((node << 1), beg, mid, i, j, target);
}
long long query_f(int node, int beg, int end, int i, int j) {
  if (i > end || j < beg) return (1LL << 60);
  if (beg >= i && end <= j) return seg_tree_f[node];
  split_node_f(node);
  int mid = (beg + end) >> 1;
  long long leftnode = query_f((node << 1), beg, mid, i, j);
  long long rightnode = query_f(((node << 1) | 1), mid + 1, end, i, j);
  return min(leftnode, rightnode);
}
long long seg_tree[400000 * 4 + 9];
long long lazy[400000 * 4 + 9];
void init_tree(int node, int beg, int end) {
  if (beg == end) {
    seg_tree[node] = 0;
    lazy[node] = 0;
    return;
  }
  int mid = (beg + end) >> 1;
  init_tree((node << 1), beg, mid);
  init_tree((node << 1) | 1, mid + 1, end);
  seg_tree[node] = 0;
  lazy[node] = 0;
}
void split_node(int node) {
  if (lazy[node] == 0) return;
  seg_tree[(node << 1)] += lazy[node];
  lazy[(node << 1)] += lazy[node];
  seg_tree[(node << 1) | 1] += lazy[node];
  lazy[(node << 1) | 1] += lazy[node];
  lazy[node] = 0;
}
void merge_node(int node) {
  seg_tree[node] = max(seg_tree[(node << 1)], seg_tree[(node << 1) | 1]);
}
void update(int node, int beg, int end, int i, int j, long long value) {
  if (beg > j || end < i) return;
  if (beg >= i && end <= j) {
    seg_tree[node] += value;
    lazy[node] += value;
    return;
  }
  split_node(node);
  int mid = (beg + end) >> 1;
  update((node << 1), beg, mid, i, j, value);
  update((node << 1) | 1, mid + 1, end, i, j, value);
  merge_node(node);
}
long long query_leftmost(int node, int beg, int end, int i, int j,
                         long long target) {
  if (i > end || j < beg) return (1 << 30);
  if (seg_tree[node] < target) return (1 << 30);
  if (beg == end) return beg;
  split_node(node);
  int mid = (beg + end) >> 1;
  int ind = query_leftmost((node << 1), beg, mid, i, j, target);
  if (ind != (1 << 30)) return ind;
  return query_leftmost(((node << 1) | 1), mid + 1, end, i, j, target);
}
long long query_rightmost(int node, int beg, int end, int i, int j,
                          long long target) {
  if (i > end || j < beg) return (-(1 << 30));
  if (seg_tree[node] < target) return (-(1 << 30));
  if (beg == end) return beg;
  split_node(node);
  int mid = (beg + end) >> 1;
  int ind = query_rightmost(((node << 1) | 1), mid + 1, end, i, j, target);
  if (ind != (-(1 << 30))) return ind;
  return query_rightmost((node << 1), beg, mid, i, j, target);
}
long long query(int node, int beg, int end, int i, int j) {
  if (i > end || j < beg) return (-(1LL << 60));
  if (beg >= i && end <= j) return seg_tree[node];
  split_node(node);
  int mid = (beg + end) >> 1;
  long long leftnode = query((node << 1), beg, mid, i, j);
  long long rightnode = query(((node << 1) | 1), mid + 1, end, i, j);
  return max(leftnode, rightnode);
}
long long MAP[400000 + 9];
long long ar[400000 + 9];
long long ANC[400000 + 9];
void GO(int l, int r, int n, int carry) {
  if (l > r) return;
  int m = MAP[query_f(1, 1, n, l, r)];
  ANC[m] = carry;
  GO(l, m - 1, n, carry + 1);
  GO(m + 1, r, n, carry + 1);
}
int main() {
  long long i, j, k, l, cas, ne, test, n, m, x, y, temp, val, now, q, w, e,
      root, flag, ii, o, p, ans, r;
  cin >> n;
  for (i = 1; i <= n; i++) scanf("%lld", &ar[i]);
  for (i = 1; i <= n; i++) MAP[ar[i]] = i;
  init_tree_f(1, 1, n);
  for (i = 1; i <= n; i++) update_f(1, 1, n, i, i, ar[i]);
  GO(1, n, n, 0);
  init_tree_f(1, 1, 2 * n);
  for (i = 1; i <= n; i++) ar[i + n] = ar[i];
  for (i = 1; i <= 2 * n; i++) update_f(1, 1, 2 * n, i, i, ar[i]);
  init_tree(1, 1, 2 * n);
  for (i = 1; i <= n; i++) ANC[i + n] = ANC[i];
  for (i = 1; i <= 2 * n; i++) update(1, 1, 2 * n, i, i, ANC[i]);
  ans = seg_tree[1];
  val = 0;
  for (i = 1; i < n; i++) {
    l = query_f_leftmost(1, 1, 2 * n, i + 1, n + i - 1, ar[i]);
    if (l != (1 << 30)) update(1, 1, 2 * n, i + 1, l - 1, -1);
    r = query_f_rightmost(1, 1, 2 * n, i + 1, n + i - 1, ar[i]);
    if (r != (-(1 << 30))) update(1, 1, 2 * n, r + 1, n + i - 1, 1);
    update(1, 1, 2 * n, n + i, n + i, -(query(1, 1, 2 * n, n + i, n + i)));
    if (r != (-(1 << 30)))
      update(1, 1, 2 * n, n + i, n + i, (query(1, 1, 2 * n, r, r) + 1));
    temp = query(1, 1, 2 * n, i + 1, i + n);
    if (temp < ans) {
      ans = temp;
      val = i;
    }
  }
  cout << ans + 1 << " " << val << endl;
}
