#include <bits/stdc++.h>
using namespace std;
const int N = 12345;
int n, h[N], f[N], p[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", h + i);
    p[i] = p[i - 1] + h[i];
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i - 1; j >= 0; --j) {
      if (f[j] <= p[i] - p[j]) {
        f[i] = p[i] - p[j];
        break;
      }
    }
  }
  int ans = n;
  for (int i = n; i;) {
    int here = f[i];
    --ans;
    while (i and here) here -= h[i--];
  }
  cout << ans << endl;
  return 0;
}
