N = int(input()) a = list(map(int,input().split())) def calc(x): count = 0 now = 0 left = 0 while left < N: right = left while right < N and now + a[right] <= x: now += a[right] right += 1 if now < x: return 0 now = 0 count += 1 left = right return count ans = 0 Sum = 0 S = sum(a) M = max(a) for i in a: Sum += i if Sum > S // 2:break if Sum < M:continue t = calc(Sum) if t > ans: ans = t print(ans)