local n = io.read("*n")
local a = {}
for i = 1, n do a[i] = io.read("*n") end
local ret = 1000000007 * 1000000007
for flag = -1, 1, 2 do
  local cur = 0
  local cnt = 0
  for i = 1, n do
    cur = cur + a[i]
    if flag < 0 then
      if 0 <= cur then
        cnt = cnt + cur + 1
        cur = -1
      end
    else
      if cur <= 0 then
        cnt = cnt - cur + 1
        cur = 1
      end
    end
    flag = flag * -1
  end
  ret = math.min(ret, cnt)
end
print(ret)
