import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.string;
import std.math;

void main() {
  int n = readln.chomp.to!int;
  auto A = readln.chomp.split.map!(to!int).array;
  long ans = 1000000000000007;

  for (int i = 0; i < 2; ++i) {
    auto a = A;
    long tmp;
    long[] sum_a = new long[](n);

    // 偶数番目が正の数
    if (i == 0) {
      for (int j = 0; j < n; ++j) {
        sum_a[j] = a[j] + (j == 0 ? 0 : sum_a[j - 1]);

        if (j % 2 == 0 && sum_a[j] <= 0) {
          long dif = 1 - sum_a[j];
          a[j] += dif;
          sum_a[j] += dif;
          tmp += dif.abs;
        }
        else if (j % 2 == 1 && sum_a[j] >= 0) {
          long dif = -1 - sum_a[j];
          a[j] += dif;
          sum_a[j] += dif;
          tmp += dif.abs;
        }
      }
    }
    else {
      for (int j = 0; j < n; ++j) {
        sum_a[j] = a[j] + (j == 0 ? 0 : sum_a[j - 1]);

        if (j % 2 == 1 && sum_a[j] <= 0) {
          long dif = 1 - sum_a[j];
          a[j] += dif;
          sum_a[j] += dif;
          tmp += dif.abs;
        }
        else if (j % 2 == 0 && sum_a[j] >= 0) {
          long dif = -1 - sum_a[j];
          a[j] += dif;
          sum_a[j] += dif;
          tmp += dif.abs;
        }
      }
    }

    ans = ans.min(tmp);
  }

  ans.writeln;

  return;
}
