integer N
integer(16),allocatable,dimension(:)::A
integer(16) Asum,ans,preans
read*,N
allocate(A(N))
read*,A

Asum=0;preans=0
do i=1,N
  Asum=Asum+A(i)
  select case(mod(i,2))
    case(1)
      if(Asum<=0)then
        preans=preans+abs(1-Asum)
        Asum=1
      endif
    case(0)
      if(Asum>=0)then
        preans=preans+abs(-1-Asum)
        Asum=-1
      endif
  end select
end do
ans=preans
Asum=0;preans=0
do i=1,N
  Asum=Asum+A(i)
  select case(mod(i,2))
    case(0)
      if(Asum<=0)then
        preans=preans+abs(1-Asum)
        Asum=1
      endif
    case(1)
      if(Asum>=0)then
        preans=preans+abs(-1-Asum)
        Asum=-1
      endif
  end select
end do
ans=min(ans,preans)
print"(i0)",ans
end