# -*- coding:utf-8 -*-
#不用递归!--人生苦短我用python
#首尾指针跟踪
#两个数不相等就进行加法:小的数加上相邻的值
def huiwen(item, head, tail):
times=0
left = item[0] # head = 0
right = item[-1] # tail = n-1
while (head<tail):
if left<right:
head+=1
left+=item[head]
times+=1
continue
elif left>right:
tail-=1
right+=item[tail]
times+=1
continue
elif left==right:
head+=1
tail-=1
left = item[head]
right = item[tail]
return times
if __name__ == "__main__":
n = int(raw_input().strip())
item = [int(x) for x in raw_input().strip().split()]
print huiwen(item,0,n-1)
'''
def test_func(L):
import copy
L1 = copy.deepcopy(L)
L1.reverse()
num = 0
while L1 != L:
func(L)
num += 1
return num
def add_func(L):
L
if __name__ == "__main__":
#n = int(raw_input("Enter n: "))
#L = map(int, raw_input("enter n numbers: ").split(','))
L = [1,2,3,4,5]
result = test_func(L)
print result
'''
程序摘自牛客网一位网友,再次表示感谢