#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn], b[maxn], c[maxn], lson[maxn], rson[maxn], stk[maxn];
int vis[maxn];
int dep[maxn];
int rt, n;
void build() {
  int top = 0;
  for (int i = 1; i <= n; i++) {
    lson[i] = rson[i] = vis[i] = 0;
  }
  for (int i = 1; i <= n; i++) {
    int k = top;
    while (k > 0 && a[stk[k - 1]] > a[i]) k--;
    if (k) rson[stk[k - 1]] = i;
    if (k < top) lson[i] = stk[k];
    stk[k++] = i;
    top = k;
  }
  for (int i = 1; i <= n; i++) {
    vis[lson[i]] = vis[rson[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) rt = i;
  }
}
void dfs(int u) {
  dep[u] = 1;
  if (lson[u]) dfs(lson[u]), dep[u] = max(dep[u], dep[lson[u]] + 1);
  if (rson[u]) dfs(rson[u]), dep[u] = max(dep[u], dep[rson[u]] + 1);
}
pair<int, int> solve(int p) {
  build();
  dfs(rt);
  if (dep[lson[rt]] <= dep[rson[rt]]) return {dep[rt], 0};
  int l = 0, r = p - 1, shift, depth;
  while (l <= r) {
    int mid = l + r >> 1;
    for (int i = mid % n + 1, j = 1; j <= n; j++, i = i % n + 1) {
      b[j] = a[i];
      c[j] = a[j];
    }
    for (int i = 1; i <= n; i++) {
      a[i] = b[i];
    }
    build();
    dfs(rt);
    if (dep[lson[rt]] >= dep[rson[rt]]) {
      l = mid + 1;
      shift = mid;
      depth = dep[rt];
    } else
      r = mid - 1;
    for (int i = 1; i <= n; i++) a[i] = c[i];
  }
  l = 0, r = shift;
  while (l <= r) {
    int mid = l + r >> 1;
    for (int i = mid % n + 1, j = 1; j <= n; j++, i = i % n + 1) {
      b[j] = a[i];
      c[j] = a[j];
    }
    for (int i = 1; i <= n; i++) {
      a[i] = b[i];
    }
    build();
    dfs(rt);
    if (dep[rt] == depth) {
      r = mid - 1;
      shift = mid;
    } else
      l = mid + 1;
    for (int i = 1; i <= n; i++) a[i] = c[i];
  }
  return {depth, shift};
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  int p;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      p = i;
    }
  }
  pair<int, int> ans1 = solve(p);
  for (int i = p % n + 1, j = 1; j <= n; j++, i = i % n + 1) {
    b[j] = a[i];
  }
  for (int i = 1; i <= n; i++) a[i] = b[i];
  pair<int, int> ans2 = solve(n);
  ans2.second += p;
  ans1 = min(ans1, ans2);
  cout << ans1.first << " " << ans1.second << endl;
}
