#include <bits/stdc++.h>
using namespace std;
int main() {
freopen("permutrans.in","r",stdin);
freopen("permutrans.out","w",stdout);
int n;
cin >> n;
int p[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int c = 0;
int s = 0;
for (int i = 0; i < n; i++) {
int count = 0;
for (int j = 0; j < n; j++) {
if (p[(j + i) % n] >= j + 1) {
count++;
s=j;
}
}
if (count > c) {
c=count;
}
}
cout << c << " " << s << endl;
return 0;
}