#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long md = 1000000007) {
  long long res = 1;
  x %= md;
  while (y > 0) {
    if (y & 1) res = (res * x) % md;
    x = (x * x) % md;
    y = y >> 1;
  }
  return res % md;
}
long long max1(long long a, long long b, long long c = -1000000000000000000LL,
               long long d = -1000000000000000000LL) {
  long long mx1 = (a > b) ? a : b, mx2 = (c > d) ? c : d;
  return ((mx1 > mx2) ? mx1 : mx2);
}
long long tree[800005] = {0};
long long lazy[800005] = {0};
void update_tree(long long node, long long a, long long b, long long i,
                 long long j, long long value) {
  if (lazy[node] != 0) {
    tree[node] += lazy[node];
    if (a != b) {
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 2] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a > b || a > j || b < i) return;
  if (a >= i && b <= j) {
    tree[node] += value;
    if (a != b) {
      lazy[node * 2 + 1] += value;
      lazy[node * 2 + 2] += value;
    }
    return;
  }
  update_tree(node * 2 + 1, a, (a + b) / 2, i, j, value);
  update_tree(node * 2 + 2, (a + b) / 2 + 1, b, i, j, value);
  tree[node] = max(tree[node * 2 + 1], tree[node * 2 + 2]);
}
long long query_tree(long long node, long long a, long long b, long long i,
                     long long j) {
  if (a > b || a > j || b < i) return -1000000000000000000LL;
  if (lazy[node] != 0) {
    tree[node] += lazy[node];
    if (a != b) {
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 2] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j) return tree[node];
  long long q1 = query_tree(node * 2 + 1, a, (a + b) / 2, i, j);
  long long q2 = query_tree(node * 2 + 2, (a + b) / 2 + 1, b, i, j);
  long long res = max(q1, q2);
  return res;
}
long long seg[800005];
void update(long long index, long long ss, long long se, long long id,
            long long val) {
  if (ss == se) {
    seg[index] = val;
    return;
  }
  if (id > se || id < ss) return;
  long long mid = (ss + se) / 2;
  update(index * 2 + 1, ss, mid, id, val);
  update(index * 2 + 2, mid + 1, se, id, val);
  seg[index] = max(seg[index * 2 + 1], seg[index * 2 + 2]);
}
long long query(long long index, long long ss, long long se, long long qs,
                long long qe) {
  if (qs <= ss && se <= qe) return seg[index];
  if (qs > se || qe < ss) return -1000000000000000000LL;
  long long mid = (ss + se) / 2;
  return max(query(index * 2 + 1, ss, mid, qs, qe),
             query(index * 2 + 2, mid + 1, se, qs, qe));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  for (long long i = 0; i <= 800004; i++) seg[i] = 0;
  long long n;
  cin >> n;
  vector<long long> v(n), vv;
  map<long long, long long> make_pair;
  for (long long i = 0; i < n; i++) cin >> v[i], make_pair[v[i] - 1] = i;
  for (long long i = make_pair[0]; i < n; i++) vv.push_back(v[i]);
  for (long long i = 0; i < make_pair[0]; i++) vv.push_back(v[i]);
  v = vv;
  vector<long long> ans(n, 0), ans1(n, 0);
  for (long long i = 1; i < n; i++) {
    long long prev = query(0, 0, n - 1, 0, v[i] - 2);
    long long qq = query_tree(0, 0, n - 1, prev, prev);
    update(0, 0, n - 1, v[i] - 1, i);
    if (prev + 1 <= i - 1) update_tree(0, 0, n - 1, prev + 1, i - 1, 1);
    update_tree(0, 0, n - 1, i, i, qq + 1);
    ans[i] = query_tree(0, 0, n - 1, 0, i);
  }
  reverse(v.begin() + 1, v.end());
  for (long long i = 0; i <= 800004; i++) seg[i] = lazy[i] = tree[i] = 0;
  for (long long i = 1; i < n; i++) {
    long long prev = query(0, 0, n - 1, 0, v[i] - 2);
    long long qq = query_tree(0, 0, n - 1, prev, prev);
    update(0, 0, n - 1, v[i] - 1, i);
    if (prev + 1 <= i - 1) update_tree(0, 0, n - 1, prev + 1, i - 1, 1);
    update_tree(0, 0, n - 1, i, i, qq + 1);
    ans1[i] = query_tree(0, 0, n - 1, 0, i);
  }
  long long ff = 1000000000000000000LL;
  long long mnx = -1;
  for (long long i = 0; i < n; i++) {
    if (max(ans[i], ans1[n - 1 - i]) < ff) {
      ff = max(ans[i], ans1[n - 1 - i]);
      mnx = i + 1;
    }
  }
  mnx += make_pair[0];
  mnx %= n;
  cout << ff + 1 << " " << mnx;
}
