local n = io.read("*n", "*l")
local str = io.read()
local a = {}
for v in str:gmatch("(%-?%d+)") do
  table.insert(a, tonumber(v))
end
local stepmin = nil
for type = -1, 1, 2 do
  local step = 0
  local sum = 0
  local flag = type
  for i = 1, n do
    sum = sum + a[i]
    if flag == 1 then
      if sum <= 0 then
        step = step + 1 - sum
        sum = 1
      end
    else
      if 0 <= sum then
        step = step + 1 + sum
        sum = -1
      end
    end
    flag = -flag
  end
  if type == -1 then stepmin = step else stepmin = math.min(stepmin, step) end
end
print(stepmin)
