Problem: Gardener Alex loves to grow trees. We remind that tree is a connected acyclic graph on n vertices. 

Today he decided to grow a rooted binary tree. A binary tree is a tree where any vertex has no more than two sons. Luckily, Alex has a permutation of numbers from 1 to n which he was presented at his last birthday, so he decided to grow a tree according to this permutation. To do so he does the following process: he finds a minimum element and makes it a root of the tree. After that permutation is divided into two parts: everything that is to the left of the minimum element, and everything that is to the right. The minimum element on the left part becomes the left son of the root, and the minimum element on the right part becomes the right son of the root. After that, this process is repeated recursively on both parts.

Now Alex wants to grow a forest of trees: one tree for each cyclic shift of the permutation. He is interested in what cyclic shift gives the tree of minimum depth. Unfortunately, growing a forest is a hard and long process, but Alex wants the answer right now. Will you help him?

We remind that cyclic shift of permutation a_1, a_2, …, a_k, …, a_n for k elements to the left is the permutation a_{k + 1}, a_{k + 2}, …, a_n, a_1, a_2, …, a_k.

Input

First line contains an integer number n ~ (1 ⩽ n ⩽ 200 000) — length of the permutation.

Second line contains n integer numbers a_1, a_2, …, a_n ~ (1 ⩽ a_i ⩽ n), and it is guaranteed that all numbers occur exactly one time.

Output

Print two numbers separated with space: minimum possible depth of a tree and how many elements we need to shift left to achieve this depth. The number of elements should be a number from 0 to n - 1. If there are several possible answers, print any of them.

Example

Input


4
1 2 3 4


Output


3 2

Note

The following picture depicts all possible trees for sample test and cyclic shifts on which they are achieved. 

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
template <class T>
struct RangeST {
  const int n, h;
  vector<T> V, D;
  vector<char> B;
  function<T(T, T)> op;
  function<T(T, T, int)> al;
  RangeST(
      const vector<T>& A, function<T(T, T)> op = plus<T>(),
      function<T(T, T, int)> al = [](T v, T d, int k) { return v + d * k; })
      : n(A.size()),
        h(32 - __builtin_clz(n)),
        V(n * 2),
        D(n),
        B(n),
        op(op),
        al(al) {
    copy(A.begin(), A.end(), V.begin() + n), build(0, n);
  }
  void calc(int p, int k) {
    T t = op(V[p << 1], V[p << 1 | 1]);
    V[p] = B[p] ? al(t, D[p], k) : t;
  }
  void apply(int p, T val, int k) {
    V[p] = al(V[p], val, k);
    if (p < n) D[p] = B[p] ? al(D[p], val, 1) : val, B[p] = true;
  }
  void build(int l, int r) {
    l += n, r += n - 1;
    for (int k = 2; l > 1; k <<= 1) {
      l >>= 1, r >>= 1;
      for (int i = r; i >= l; i--) calc(i, k);
    }
  }
  void push(int l, int r) {
    int s = h, k = 1 << (h - 1);
    for (l += n, r += n - 1; s > 0; --s, k >>= 1)
      for (int i = l >> s; i <= r >> s; i++)
        if (B[i])
          apply(i << 1, D[i], k), apply(i << 1 | 1, D[i], k), B[i] = false;
  }
  void modify(int l, int r, T val) {
    assert(l < r), push(l, l + 1), push(r - 1, r);
    int l0 = l, r0 = r, k = 1;
    for (l += n, r += n; l < r; l >>= 1, r >>= 1, k <<= 1) {
      if (l & 1) apply(l++, val, k);
      if (r & 1) apply(--r, val, k);
    }
    build(l0, l0 + 1), build(r0 - 1, r0);
  }
  T query(int l, int r) {
    assert(l < r), push(l, l + 1), push(r - 1, r);
    T left = T(), right = T();
    bool b1 = false, b2 = false;
    for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
      if (l & 1) left = b1 ? op(left, V[l++]) : V[l++], b1 = true;
      if (r & 1) right = b2 ? op(V[--r], right) : V[--r], b2 = true;
    }
    return !b1 ? right : !b2 ? left : op(left, right);
  }
};
const int N = 200003;
int n;
int main() {
  cin >> n;
  vector<int> a(n + n + 1), b(n + n + 1);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]), a[i + n] = a[i];
  auto st_min = RangeST<int>(
      a, [](int x, int y) { return min(x, y); },
      [](int x, int y, int k) { return x + y; });
  deque<int> st;
  for (int i = 1; i <= n; ++i) {
    while (!st.empty() && a[st.back()] > a[i]) st.pop_back();
    st.push_back(i);
    b[i] += st.size();
  }
  st.clear();
  for (int i = n; i >= 1; --i) {
    while (!st.empty() && a[st.back()] > a[i]) st.pop_back();
    b[i] += st.size();
    st.push_back(i);
  }
  auto st_cnt = RangeST<int>(
      b, [](int x, int y) { return max(x, y); },
      [](int x, int y, int k) { return x + y; });
  int ans = INT_MAX, shift = -1;
  st.clear();
  for (int i = 1; i <= n; ++i) {
    while (!st.empty() && a[st.back()] > a[i]) st.pop_back();
    st.push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    int cur = st_cnt.query(i, i + n);
    if (cur < ans) ans = cur, shift = i - 1;
    int l = i, r = i + n;
    while (l + 1 < r) {
      int m = (l + r) >> 1;
      if (st_min.query(i, m + 1) >= a[i])
        l = m;
      else
        r = m;
    }
    if (l > i) st_cnt.modify(i + 1, l + 1, -1);
    l = i, r = i + n;
    while (l + 1 < r) {
      int m = (l + r + 1) >> 1;
      if (st_min.query(m, i + n + 1) >= a[i])
        r = m;
      else
        l = m;
    }
    if (r < i + n) st_cnt.modify(r, i + n, 1);
    while (!st.empty() && a[st.back()] >= a[i]) st.pop_back();
    st.push_back(i);
    st_cnt.modify(i + n, i + n + 1, st.size());
  }
  cout << ans << ' ' << shift << endl;
  return 0;
}