#include <bits/stdc++.h>
using namespace std;
#define int long long
const int inf = 2e18;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(nullptr); cout.tie(nullptr);
int n, ans = 0;
cin >> n;
vector<int> a(n + 1, 0);
for(int i = 1; i <= n; ++i){
cin >> a[i];
}
vector<int> pdp(n + 1, inf);
pdp[0] = 0;
for(int k = 1; k <= n; ++k){
vector<int> ndp(n + 2, inf);
for(int i = 1; i <= n; ++i){
for(int j = i, s = 0; j >= 1; --j){
s += a[j];
if(s >= pdp[j - 1]){
ndp[i] = s;
break;
}
}
if(ndp[i] < inf) ans = max(ans, k);
}
swap(ndp, pdp);
}
cout << ans << "\n";
return 0;
}