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 arr = let (_, plus, _) = foldl update (0, 0, True) arr
                   (_, minus, _) = foldl update (0, 0, False) arr
               in min plus minus

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

calcNext :: Int -> Bool -> Int
calcNext a b = if b then 1 - a else -1 - a

