import std.stdio, std.conv, std.algorithm, std.range, std.array, std.string, std.uni, std.bigint, std.math;

void main() {
  auto n = readln.chomp.to!uint;
  auto an = readln.split.to!(long[]);
  min(func(an, 0), func(an, 1)).writeln;
}

ulong func(long[] an, uint mod) {
  long sum = 0;
  ulong res = 0;
  foreach(i,a; an) {
    sum += a;
    if (i % 2 == mod && sum <= 0) {
      res += 1 - sum;
      sum = 1;
    }
    if (i % 2 != mod && sum >= 0) {
      res += 1 + sum;
      sum = -1;
    }
  }
  return res;
}
