You are given $n$ numbers $a_1, a_2, \dots, a_n$. With a cost of one coin you can perform the following operation:

Choose one of these numbers and add or subtract $1$ from it.

In particular, we can apply this operation to the same number several times.

We want to make the product of all these numbers equal to $1$, in other words, we want $a_1 \cdot a_2$ $\dots$ $\cdot a_n = 1$. 

For example, for $n = 3$ and numbers $[1, -3, 0]$ we can make product equal to $1$ in $3$ coins: add $1$ to second element, add $1$ to second element again, subtract $1$ from third element, so that array becomes $[1, -1, -1]$. And $1\cdot (-1) \cdot (-1) = 1$.

What is the minimum cost we will have to pay to do that?


-----Input-----

The first line contains a single integer $n$ ($1 \le n \le 10^5$) — the number of numbers.

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($-10^9 \le a_i \le 10^9$) — the numbers.


-----Output-----

Output a single number — the minimal number of coins you need to pay to make the product equal to $1$.


-----Examples-----
Input
2
-1 1

Output
2
Input
4
0 0 0 0

Output
4
Input
5
-5 -3 5 3 0

Output
13


-----Note-----

In the first example, you can change $1$ to $-1$ or $-1$ to $1$ in $2$ coins.

In the second example, you have to apply at least $4$ operations for the product not to be $0$.

In the third example, you can change $-5$ to $-1$ in $4$ coins, $-3$ to $-1$ in $2$ coins, $5$ to $1$ in $4$ coins, $3$ to $1$ in $2$ coins, $0$ to $1$ in $1$ coin.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
A = list(map(int, input().split()))
m = 0
pos = 0
neg = 0
for i in range(n):
    if A[i] < 0:
        neg += 1
        m += (-A[i] - 1)
        A[i] = -1
    elif A[i] > 0:
        pos += 1
        m += (A[i] - 1)
        A[i] = 1
zer = n - pos - neg
if zer:
    print(m + zer)
elif neg % 2 == 0:
    print(m)
else:
    print(m + 2)

import sys
input = sys.stdin.readline
from collections import defaultdict, deque

n = int(input())
l = list(map(int, input().split()))
pos = 0
neg = 0
z = 0
ans = 0
for x in l:
	if x > 0:
		pos += 1
		ans += x - 1
	elif x < 0:
		neg += 1
		ans += -1 - x
	else:
		z += 1
		ans += 1
if neg % 2 == 0:
	print(ans)
elif z > 0:
	print(ans)
else:
	print(ans + 2)

n = int(input())
a = list(map(int, input().split()))
num = 0
mi = 0
zero = 0
for i in range(n):
    if a[i] == 0:
        num += 1
        zero += 1
    elif a[i] > 0:
        num += a[i] - 1
    else:
        num += abs(a[i]) - 1
        mi += 1

if zero > 0:
    print(num)
else:
    if mi % 2 != 0:
        print(num + 2)
    else:
        print(num)

n = int(input())
a = [int(item) for item in input().split()]
ans = 0
minus_cnt = 0
includes_zero = False
for item in a:
    if item == 0:
        includes_zero = True
        ans += 1
    elif item <= -1:
        minus_cnt += 1
        ans += -1 - item
    else:
        ans += item - 1
if includes_zero:
    print(ans)
elif minus_cnt % 2 == 0:
    print(ans)
else:
    print(ans + 2)

n = int(input())
a = list(map(int, input().split()))
ans = 0
flag = True
for i in range(n):
    if a[i] != 0:
        ans += abs(a[i]) - 1
        a[i] /= abs(a[i])
    else:
        a[i] = 1
        ans += 1
        flag = False
if flag and a.count(-1) % 2 != 0:
    ans += 2
print(ans)

n=int(input())
arr=list(map(int,input().split()))
arr.sort()
ans=0
countn=0
count0=0
for i in range(n):
	if(arr[i]<0):
		countn+=1
		ans+=(-1-arr[i])
	elif(arr[i]>0):
		ans+=arr[i]-1
	else:
		count0+=1

if(countn%2!=0):
	if(count0>0):
		ans+=count0
		count0=0
	else:
		ans+=2
ans+=count0
print(ans)


N = int(input())
A = list(map(int, input().split()))
zflag = False
ans = 0
cnt = 1

for a in A:
    if a == 0:
        zflag = True
        ans += 1
    elif a < 0:
        cnt *= -1
        ans += abs(-1-a)
    else:
        ans += abs(1-a)

if not zflag and cnt == -1:
    ans += 2

print(ans)

n = int(input())
l = list(map(int,input().split()))
def sgn(x):
	if x > 0:
		return 1
	else:
		return -1
s = sgn(l[0])
wynik = 0
zera = 0
for i in range(n):
	wynik += (abs(l[i]) - 1 if l[i] != 0 else 1)
	if l[i] == 0:
		zera = 1
if zera == 1:
	print(wynik)
else:
	mn = 1
	for i in range(n):
		mn *= sgn(l[i])
	if mn == 1:
		print(wynik)
	else:
		print(wynik + 2)

n = int(input())
a = [int(x) for x in input().split()]

price = 0
if 0 in a:
    for i in range(n):
        if a[i] != 0: price += abs(a[i]) - 1
        else: price += 1
    print(price)
else:
    cnt = 0
    for i in range(n):
        price += abs(a[i]) - 1
        cnt += a[i] < 0
    print(price + 2 * (cnt % 2))



import math
# helpful:
# r,g,b=map(int,input().split())
#list1 = input().split()
#for i in range(len(list1)):
#    list1[i] = int(list1[i])
# print(list1)
# arr = [[0 for x in range(columns)] for y in range(rows)]

n = int(input())
list1 = input().split()
for i in range(len(list1)):
    list1[i] = int(list1[i])
total = 0
numNeg = 0
wiggle = False
for i in range(len(list1)):
    if(list1[i] >= 1):
        total += (list1[i] - 1)
    elif(list1[i] <= -1):
        total += (-1 - list1[i])
        numNeg += 1
    else:
        total += 1
        wiggle = True
if(wiggle):
    print(total)
else:
    if(numNeg % 2 == 1):
        print(total+2)
    else:
        print(total)


def mi():
        return list(map(int, input().split()))
'''
5
-5 -3 5 3 0
'''
n = int(input())
a = sorted(list(mi()))
ans = 0
skip=False
for i in range(n):
    if skip:
        skip=False
        continue
    if i<n-1:
        if abs(-1-a[i])+abs(-1-a[i+1])<=abs(1-a[i])+abs(1-a[i+1]):
            ans+=abs(-1-a[i])+abs(-1-a[i+1])
        else:
            ans+=abs(1-a[i])+abs(1-a[i+1])
        skip = True
    else:
        ans+=abs(1-a[i])
print (ans)


n = int(input())
a = list(map(int,input().split()))
z = False
mi = 1
sc = 0
for i in a:
    if i == 0:
        z = True
        sc += 1
        continue
    sc += abs(i) - 1
    if(i < 0):
        mi *= -1
if mi == -1 and not z:
    sc += 2
print(sc)


n=int(input())
a=[int(x) for x in input().split()]
arr=counter=0
for item in a:
    if abs(item+1)<=abs(item-1):
        arr+=abs(item+1)
        counter+=1
    else:
        arr+=abs(item-1)
if counter%2==1:
    if 0 in a:
        print(arr)
    else:
        print(arr+2)
else:
    print(arr)
        


n=int(input())
a=[int(x) for x in input().split()]
zeroCount=0
negCount=0
ans=0

for i in range(n):
    if a[i]==0:
        zeroCount=zeroCount+1
        ans+=1
    elif a[i]<0:
        negCount=negCount+1
        ans+=(-1-a[i])
    else:
        ans+=(a[i]-1)
if zeroCount>0 or negCount % 2 == 0:
    print(ans)
else:
    ans=ans+2
    print(ans)


n=int(input())
a=list(map(int,input().split()))
mi=0
ans=0
o=0
for i in range(n):
    if a[i]<0:
        ans+=-1-a[i]
        mi+=1
    elif a[i]==0:
        o+=1
        ans+=1
    else:
        ans+=a[i]-1
if mi%2==1:
    if o==0:
        ans+=2
print(ans)
        


q=int(input())
w=list(map(int,input().split()))
e=0
r=0
t=0
for i in w:
    if i<0:
        e+=-1-i
        r+=1
    elif i>0:
        e+=i-1
    else:
        e+=1
        t+=1
if r%2==1:
    if t>0:
        print(e)
    else:
        print(e+2)
else:
    print(e)

from sys import stdin
n=int(stdin.readline().strip())

s=list(map(int,stdin.readline().strip().split()))
dp=[[10**15,10**15] for i in range(n)]
dp[0][0]=abs(s[0]-1)
dp[0][1]=abs(s[0]-(-1))
for i in range(1,n):
    un=abs(s[i]-1)
    mun=abs(s[i]-(-1))
    dp[i][0]=min(dp[i-1][0]+un,dp[i-1][1]+mun)
    dp[i][1]=min(dp[i-1][1]+un,dp[i-1][0]+mun)
print(dp[-1][0])


n = int(input())
a = list(map(int, input().split()))

ans = 0
zero = 0
nega = 0
for i in range(n):
    if a[i] == 0:
        zero += 1
    elif a[i] < 0:
        nega += 1
        ans += - 1 - a[i]
    else:
        ans += a[i] - 1

if nega % 2 == 1:
    if zero > 0:
        zero -= 1
        ans += 1
    else:
        ans += 2

ans += zero
print(ans)


n = int(input())

a = list(map(int, input().split()))

count = 0
neg = 0
flag = False

for i in a:
    if i > 0:
        count += i - 1
    elif i < 0:
        count += - i - 1
        neg += 1
    else:
        count += 1
        flag = True

if not flag:
    if neg%2 == 1:
        count += 2

print(count)

n=int(input())
a=list(map(int,input().split()))
totneg=0
tot=0
zero=0
for i in a:
    if i<0:
        if i==0:zero=1
        totneg+=1
        tot+=abs(i)-1
    elif i==0:
        zero=1
        totneg+=1
        tot+=1
    else:
        tot+=i-1
if totneg%2:
    if zero:
        print(tot)
    else:print(tot+2)
else:print(tot)

from sys import stdin
input = stdin.readline

n = int(input())
a = [int(i) for i in input().split()]

num_neg = 0
num_zero = 0
cost = 0

for i in range(n):
    if a[i] == 0:
        cost += 1
        num_zero += 1
    elif a[i] < 0:
        num_neg += 1
        cost += (-1-a[i])
    else:
        cost += a[i]-1
        
if num_zero > 0: print(cost)
elif num_neg % 2 == 1: print(cost+2)
else: print(cost)

n = int(input())
a = list(map(int, input().split()))

answer = 0
negative = 0
for i in range(n):
	answer += abs(abs(a[i]) - 1)
	if a[i] < 0:
		negative += 1

if negative % 2 == 1:
	if 0 not in a:
		answer += 2

print(answer)


n = int(input())
array = list(map(int, input().split()))
total = 0
minus = 0
zero = 0

for i in range(len(array)):
    if array[i] > 0:
        total += array[i] - 1
    elif array[i] < 0:
        minus += 1
        total += -1 - array[i]
    else:
        zero += 1
        total += 1

if minus % 2 and zero == 0:
    total += 2

print(total)



import sys
input = sys.stdin.readline

def getInt(): return int(input())
def getVars(): return list(map(int, input().split()))
def getArr(): return list(map(int, input().split()))
def getStr(): return input().strip()
## -------------------------------

N = getInt()
A = getArr()

res = 0
k = 1
for i in range(N):
    res += abs(abs(A[i]) - 1)
    if A[i] == 0:
        k = 0
    if A[i] <= -1:
        k *= -1
if k >= 0:
    print(res)
else:
    print(res + 2)