#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const long long maxn = 2e5 + 10;
const long long mod = 1e9 + 7;
const long long base = 4e18;
long long a[maxn];
long long b[maxn];
pair<long long, long long> st[4 * maxn];
long long n;
pair<long long, long long> mer(pair<long long, long long> a,
                               pair<long long, long long> b) {
  if (a.first < b.first) return a;
  return b;
}
void build(long long id, long long left, long long right) {
  if (left == right) {
    st[id] = make_pair(b[left], left);
    return;
  }
  long long mid = (left + right) / 2;
  build(id * 2, left, mid);
  build(id * 2 + 1, mid + 1, right);
  st[id] = mer(st[id * 2], st[id * 2 + 1]);
}
pair<long long, long long> get(long long id, long long left, long long right,
                               long long x, long long y) {
  if (x > right || y < left) return make_pair(base, 0);
  if (x <= left && y >= right) return st[id];
  long long mid = (left + right) / 2;
  return mer(get(id * 2, left, mid, x, y),
             get(id * 2 + 1, mid + 1, right, x, y));
}
long long dfs(long long l, long long r) {
  if (l > r) return 0;
  pair<long long, long long> h = get(1, 1, n, l, r);
  long long pos = h.second;
  return max(dfs(l, pos - 1), dfs(pos + 1, r)) + 1;
}
void mov(long long pos) {
  for (int i = pos; i <= n; i++) {
    b[i] = a[i - pos + 1];
  }
  for (int i = 1; i <= pos - 1; i++) {
    b[i] = a[i + n - pos + 1];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("t.inp", "r")) {
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
  }
  cin >> n;
  long long pos;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) pos = i;
  }
  for (int i = pos; i <= n; i++) {
    b[i - pos + 1] = a[i];
  }
  for (int i = 1; i <= pos - 1; i++) {
    b[i + n - pos + 1] = a[i];
  }
  for (int i = 1; i <= n; i++) {
    a[i] = b[i];
  }
  long long l = 1, h = n;
  while (l <= h) {
    long long mid = (l + h) / 2;
    mov(mid);
    build(1, 1, n);
    if (dfs(1, mid - 1) > dfs(mid + 1, n))
      h = mid - 1;
    else
      l = mid + 1;
  }
  pair<long long, long long> ans = make_pair(base, -1);
  mov(l);
  build(1, 1, n);
  long long t = dfs(1, l - 1) + 1;
  if (ans.first > t) {
    ans = make_pair(t, l);
  }
  if (l - 1 >= 1) {
    mov(l - 1);
    build(1, 1, n);
    long long t = max(dfs(1, l - 2), dfs(l, n)) + 1;
    if (ans.first > t) {
      ans = make_pair(t, l - 1);
    }
  }
  l = 1, h = n;
  while (l <= h) {
    long long mid = (l + h) / 2;
    mov(mid);
    build(1, 1, n);
    if (dfs(1, mid - 1) < dfs(mid + 1, n))
      l = mid + 1;
    else
      h = mid - 1;
  }
  mov(h);
  build(1, 1, n);
  t = dfs(h + 1, n) + 1;
  if (ans.first > t) {
    ans = make_pair(t, h);
  }
  if (ans.second <= pos) {
    ans.second = pos - ans.second;
  } else {
    ans.second = pos + n - ans.second;
  }
  cout << ans.first << " " << ans.second << "\n";
}
