module Main
  ( main
  )
where

import           Control.Applicative
import           Control.Monad
import           Data.List
import           Data.Array
import           Data.Char

main = do
  n   <- (read :: String -> Int) <$> getLine
  arr <- map (read :: String -> Int) . words <$> getLine
  print $ calcCost arr


calcCost :: [Int] -> Int
calcCost (x : xs)
  | x /= 0
  = snd $ foldl update (x, 0) xs
  | otherwise
  = 1 + min (calcCost (1 : xs)) (calcCost ((-1) : xs))

update :: (Int, Int) -> Int -> (Int, Int)
update (s, c) v =
  let next = calcNext s
  in  if next * v > 0 && abs v > abs next
        then (s + v, c)
        else (s + next, c + abs (next - v))

calcNext :: Int -> Int
calcNext a = if a > 0 then -a - 1 else -a + 1
