#include <bits/stdc++.h>
using namespace std;
const int M = 2000011 * 2;
int n, m, k, a[M / 4], mn[M], pos1, pos2;
void built(int now, int l, int r) {
  if (l == r) {
    mn[now] = l;
    return;
  }
  int mid = (l + r) >> 1;
  built(now * 2, l, mid);
  built(now * 2 + 1, mid + 1, r);
  if (a[mn[now * 2]] < a[mn[now * 2 + 1]])
    mn[now] = mn[now * 2];
  else
    mn[now] = mn[now * 2 + 1];
}
int ask(int now, int l, int r, int L, int R) {
  if (l >= L && r <= R) return mn[now];
  int mid = (l + r) >> 1, tmp = 0, k;
  if (L <= mid) tmp = ask(now * 2, l, mid, L, R);
  if (R > mid) {
    k = ask(now * 2 + 1, mid + 1, r, L, R);
    if (!tmp || a[k] < a[tmp]) tmp = k;
  }
  return tmp;
}
int dfs(int l, int r) {
  if (l > r) return 0;
  if (l == r) return 1;
  int x = ask(1, 1, n + n + n, l, r);
  return max(dfs(l, x - 1), dfs(x + 1, r)) + 1;
}
int check(int l, int r) {
  int x;
  if (r >= pos2)
    x = pos2;
  else
    x = pos1;
  int y = dfs(l, x - 1) - dfs(x + 1, r);
  return y;
}
int main() {
  scanf("%d", &n);
  memset(mn, 0x3f, sizeof(mn));
  for (int i = 1; i <= n; i++)
    scanf("%d", &a[i]), a[i + n] = a[i + n + n] = a[i];
  for (int i = 1; i <= n; i++)
    if (a[i] == 1) pos1 = i, pos2 = i + n;
  built(1, 1, n + n + n);
  int l = pos1, r = pos2 - 1, mid, tmp = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid, mid + n - 1) >= 0)
      tmp = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  l = 1, r = n, mid;
  int tmp_ = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid, mid + n - 1) <= 0)
      tmp_ = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  if (tmp_ && (!tmp || dfs(tmp, tmp + n - 1) > dfs(tmp_, tmp_ + n - 1)))
    tmp = tmp_;
  printf("%d %d", dfs(tmp, tmp + n - 1), (tmp - 1) % n);
}
