#include <bits/stdc++.h>
using namespace std;
const int N = 3e5;
int n, a[N], init[N];
int arr[N], tree[N], len = 0;
int inv[N];
int query(int l, int r) {
  l += len;
  r += len;
  int answer = 1e9;
  for (; l <= r; l /= 2, r /= 2) {
    if (l % 2 == 1) {
      answer = min(answer, tree[l++]);
    }
    if (r % 2 == 0) {
      answer = min(answer, tree[r--]);
    }
  }
  return answer;
}
int solve(int l, int r) {
  if (l > r) {
    return 0;
  }
  if (l == r) {
    return 1;
  }
  int m = inv[query(l, r)];
  assert(l <= m && m <= r);
  return 1 + max(solve(l, m - 1), solve(m + 1, r));
}
int func() {
  for (int i = len; i < 2 * len; ++i) {
    tree[i] = arr[i - len];
  }
  for (int i = len - 1; i > 0; --i) {
    tree[i] = min(tree[2 * i], tree[2 * i + 1]);
  }
  for (int i = 0; i < len; ++i) {
    inv[arr[i]] = i;
  }
  return solve(0, len - 1);
}
int fl(int pos) {
  len = 0;
  for (int i = -pos; i < 0; ++i) {
    arr[len++] = a[(i + n) % n];
  }
  return func();
}
int fr(int pos) {
  len = 0;
  for (int i = 1; i < n - pos; ++i) {
    arr[len++] = a[i];
  }
  return func();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  copy(begin(a), end(a), init);
  rotate(a, min_element(a, a + n), a + n);
  int lef = 0, rig = n - 1;
  while (rig - lef > 1) {
    int mid = (lef + rig) / 2;
    if (fl(mid) > fr(mid)) {
      rig = mid;
    } else {
      lef = mid;
    }
  }
  int rec = -1;
  int fir = a[(n - lef) % n];
  for (int i = 0; i < n; ++i) {
    if (init[i] == fir) {
      rec = i;
    }
  }
  cout << max(fl(lef), fr(lef)) + 1 << " " << rec << "\n";
  return 0;
}
