#include<iostream>
#include<cstdio>
using namespace std;
#define MAXN 2000005
long long n, a[MAXN], ans = 0, num = 0x3f3f3f3f;
bool flag = true;
int main() {
freopen("permutrans.in", "r", stdin);
freopen("permutrans.out", "w", stdout);
scanf("%lld", &n);
for(int i = 1; i <= n; i ++) {
scanf("%lld", &a[i]);
if(a[i] != i) flag = false;
}
if(flag) { printf("%lld 0\n", n); return 0; }
for(int i = 1; i <= n; i ++)
if(a[i] >= i) ans ++;
long long l = 1, r = n;
for(int i = 1; i < n; i ++) {
a[r + 1] = a[l]; l ++; r ++;
long long tmp = 0;
for(int j = l; j <= r; j ++)
if(a[j] >= j - l + 1) tmp ++;
if(tmp >= ans) ans = tmp, num = min(num, n - i);
}
if(num != 0x3f3f3f3f) printf("%lld %lld\n", ans, num);
else printf("%lld 0\n", ans);
return 0;
}