#include <bits/stdc++.h>
using namespace std;
int n, a[105];
int main() {
cin >> n;
int cnt = 0, mx = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i + n] = a[i];
}
for (int i = 1; i <= 2 * n; i++) {
if (a[i] > a[i + 1]) {
cnt++;
} else {
mx = max(mx, cnt);
cnt = 0;
}
}
cout << mx;
return 0;
}