output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      s_1 s_2 s_3
attempt:  コードテスト
   解説
  提出 #6259010
  
  ソースコード 拡げる
  
  Copy
  Copy
  n=int(input())
  b=list(map(int,input().split()))
  a=b
  condition=''
  cnt=0
  wa=0
  for i in range(n):
    wa+=a[i]
    if i == 0:
      if a[i]>0:
        condition='minus'
      else:
        condition='plus'
    elif condition == 'plus':
      condition='minus'
      if wa<=0:
        cnt+=abs(wa)+1
        a[i]+=abs(wa)+1
        wa+=abs(wa)+1
    elif condition == 'minus':
      condition='plus'
      if wa>=0:
        cnt+=abs(wa)+1
        a[i]-=abs(wa)-1
        wa-=abs(wa)-1
  
  print(cnt)
problem_description: Statement
  
  You are given three words s_1, s_2 and s_3, each composed of lowercase English
  letters, with spaces in between. Print the acronym formed from the uppercased
  initial letters of the words.
samples: [{"input": "atcoder beginner contest", "output": "ABC\n    \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n    \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n    \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}]