#include <bits/stdc++.h>
using namespace std;
const int N = 600005;
int n, lg[N], v[N], st[N][21];
int MIN(int x, int y) { return v[x] < v[y] ? x : y; }
void init() {
  for (int i = 1; i <= n + n + n; i++) st[i][0] = i;
  for (int i = 2; i <= n + n + n; i++) lg[i] = lg[i >> 1] + 1;
  for (int i = 1; (1 << i) <= n + n + n; i++) {
    for (int j = 1; j + (1 << i) - 1 <= n + n + n; j++) {
      st[j][i] = MIN(st[j][i - 1], st[j + (1 << (i - 1))][i - 1]);
    }
  }
}
int que(int l, int r) {
  int LG = lg[r - l + 1];
  return MIN(st[l][LG], st[r - (1 << LG) + 1][LG]);
}
int dfs(int l, int r) {
  if (l > r) return 0;
  if (l == r) return 1;
  int rt = que(l, r);
  return max(dfs(l, rt - 1), dfs(rt + 1, r)) + 1;
}
int work(int x) {
  int rt = que(x, x + n - 1);
  return dfs(x, rt - 1) >= dfs(rt + 1, x + n - 1);
}
int main() {
  int minn = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", v + i);
    if (v[minn] > v[i]) minn = i;
    v[n + i] = v[n + n + i] = v[i];
  }
  init();
  int l = minn + 1, r = minn + n, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (work(mid))
      l = mid + 1, ans = mid;
    else
      r = mid - 1;
  }
  printf("%d %d\n", dfs(ans, ans + n - 1), (ans - 1) % n);
  return 0;
}
