#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n, a[MAXN], pre[MAXN], dp[MAXN], ans[MAXN], que[MAXN], head, tail = 1;
int Calc(int x) { return pre[x - 1] - dp[x]; }
int main() {
  scanf("%d", &n);
  que[++head] = n + 1;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  reverse(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i];
  for (int i = n; i >= 1; i--) {
    while (head < tail && Calc(que[head + 1]) >= pre[i - 1]) head++;
    dp[i] = pre[que[head] - 1] - pre[i - 1];
    ans[i] = ans[que[head]] + 1;
    while (head <= tail && Calc(i) >= Calc(que[tail])) tail--;
    que[++tail] = i;
  }
  printf("%d", n - ans[1]);
  return 0;
}
