local printx = print
local print = function()end
local function sign(a)
  if a>0 then return 1
  elseif a<0 then return -1
  else return 0 end
end
local N = io.read("n")
local A = {}
for i=1,N do A[i] = io.read("n") end
local gans=10^18
for k=-1,1,2 do
  local ans = 0
  local sum = 0
  local s = k
  for i=1,N do
    local newsum = sum + A[i]
    print("i",i,"A[i]",A[i],"sum",sum,"newsum",newsum)
    if sign(newsum) ~= s then
      local add = math.abs(newsum) + 1
      ans = ans + add
      sum = s
      print("abs(add)",add)
    else
      sum = newsum
    end
    s = s * -1
  end
  print("k",k,A[i],sum,ans)
  print()
  gans = math.min(gans, ans)
end
printx(gans)