import Data.List

main = do
    getLine
    as <- getInts
    print $ snd $ solve as

getInts :: IO [Int]
getInts = map read . words <$> getLine

solve :: [Int] -> (Int,Int)
solve (a:as) | a /= 0 = foldl' worker (a,0) as
             | otherwise = let a' = head as
                               s = if a' > 0 then -1 else 1
                            in foldl' worker (s,1) as

worker :: (Int,Int) -> Int -> (Int,Int)
worker (s,n) a | s*s' < 0 = (s',n)
               | s*s' >= 0 = let da = if s > 0 then -(s'+1)
                                               else -s'+1
                              in (s'+da, n + abs da)
    where s' = s + a
