#include <bits/stdc++.h>
using namespace std;
const int maxn = 400003, maxlog = 20;
int n, a[maxn], temp[maxn], st[maxn][maxlog], lg[maxn];
bool cmp(int x, int y) { return a[x] < a[y]; }
void initst() {
  for (int i = 2; i <= (n << 1); i++) lg[i] = lg[i >> 1] + 1;
  for (int i = 0; i < (n << 1); i++) st[i][0] = i;
  for (int len = 1; (1 << len) <= (n << 1); len++) {
    for (int i = 0; i + (1 << len) - 1 < (n << 1); i++) {
      st[i][len] = min(st[i][len - 1], st[i + (1 << (len - 1))][len - 1], cmp);
    }
  }
}
int query(int l, int r) {
  int tmp = lg[r - l + 1];
  return min(st[l][tmp], st[r - (1 << tmp) + 1][tmp], cmp);
}
int build(int l, int r) {
  if (l > r) return 0;
  int mid = query(l, r);
  return max(build(l, mid - 1), build(mid + 1, r)) + 1;
}
bool check(int x) {
  int mid = query(x, x + n - 1);
  return build(x, mid - 1) <= build(mid + 1, x + n - 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  int d = min_element(a, a + n) - a;
  for (int i = 0; i < n; i++) temp[i] = a[(i + d + 1) % n];
  copy(temp, temp + n, a);
  copy(a, a + n, a + n);
  initst();
  int l = 0, r = n - 1, mid, L = -1;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      L = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d %d\n", build(L, L + n - 1), (L + d + 1) % n);
  return 0;
}
