import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    (a:as) <- getIntList
    let ans | a > 0 = min (snd (foldl' f (-1,1+a) as)) (snd (foldl' f (a,0) as))
            | a < 0 = min (snd (foldl' f (1,1-a) as)) (snd (foldl' f (a,0) as))
            | a == 0 = min (snd (foldl' f (-1,1) as)) (snd (foldl' f (1,1) as))
    print ans

f (s,k) a | s > 0 && s + a < 0 = (s+a,k)
          | s > 0 = (-1, k+s+a+1)
          | s < 0 && s + a > 0 = (s+a,k)
          | s < 0 = (1, k-s-a+1)