#include <bits/stdc++.h>
using namespace std;
long long int h[100009];
long long int a[100009];
long long int ans[100009];
long long int hei[100009];
void solve() {
  long long int n;
  cin >> n;
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = i; j > 0; j--) {
      hei[j] = hei[j - 1] + a[i];
    }
    for (long long int j = 1; j <= i; j++) {
      if (hei[j] >= h[i - j]) {
        ans[i] = ans[i - j] + 1;
        h[i] = hei[j];
        break;
      }
    }
  }
  cout << (n - ans[n]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
}
