Guy-Manuel and Thomas have an array a of n integers [a1,a2,…,an]. In one step they can add 1 to any element of the array. Formally, in one step they can choose any integer index i (1≤i≤n) and do ai:=ai+1.
If either the sum or the product of all elements in the array is equal to zero, Guy-Manuel and Thomas do not mind to do this operation one more time.
What is the minimum number of steps they need to do to make both the sum and the product of all elements in the array different from zero? Formally, find the minimum number of steps to make a 1 + a 2 + … + a n ≠ 0 a n d a 1 ⋅ a 2 ⋅ … ⋅ a n ≠ 0. a1+a2+ … +an≠0 \ and\ a1⋅a2⋅ … ⋅an≠0. a1+a