import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) SUM=0 ANS=0 for i in range(N-1): if A[i]