1287_C. Garland
Vadim loves decorating the Christmas tree, so he got a beautiful garland as a present. It consists of n light bulbs in a single row. Each bulb has a number from 1 to n (in arbitrary order), such that all the numbers are distinct. While Vadim was solving problems, his home Carp removed some light bulbs from the garland. Now Vadim wants to put them back on.

<image>

Vadim wants to put all bulb back on the garland. Vadim defines complexity of a garland to be the number of pairs of adjacent bulbs with numbers with different parity (remainder of the division by 2). For example, the complexity of 1 4 2 3 5 is 2 and the complexity of 1 3 5 7 6 4 2 is 1.

No one likes complexity, so Vadim wants to minimize the number of such pairs. Find the way to put all bulbs back on the garland, such that the complexity is as small as possible.

Input

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of light bulbs on the garland.

The second line contains n integers p_1,\ p_2,\ …,\ p_n (0 ≤ p_i ≤ n) — the number on the i-th bulb, or 0 if it was removed.

Output

Output a single number — the minimum complexity of the garland.

Examples

Input


5
0 5 0 2 3


Output


2


Input


7
1 0 0 5 0 0 2


Output


1

Note

In the first example, one should place light bulbs as 1 5 4 2 3. In that case, the complexity would be equal to 2, because only (5, 4) and (2, 3) are the pairs of adjacent bulbs that have different parity.

In the second case, one of the correct answers is 1 7 3 5 6 4 2. 
```python
import sys

n = int(input())

if n == 1:
    print(0)
    sys.exit()

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

arr = [i % 2 if i != 0 else -1 for i in arr]

skipped = sum([i == -1 for i in arr])

if skipped == n:
    print(1)
    sys.exit()

ans = 0
for i in range(n - 1):
    if (arr[i] == 0) and (arr[i + 1] == 1) or (arr[i] == 1) and (arr[i + 1] == 0):
        ans += 1

if skipped == 0:
    print(ans)
    sys.exit()

even = n // 2 - sum([i == 0 for i in arr])
odd = skipped - even

if 0 not in arr:
    arr = [1] + arr + [1]
elif 1 not in arr:
    arr = [0] + arr + [0]
else:
    first = arr[min(arr.index(0), arr.index(1))]
    last = arr[n - 1 - min(arr[::-1].index(0), arr[::-1].index(1))]
    arr = [first] + arr + [last]

substrs = []
i = 0
while i != n + 2:
    if arr[i] != -1:
        i += 1
        continue
    left, j = arr[i - 1], i - 1
    while arr[i] == -1:
        i += 1
    right = arr[i]
    if left != right:
        ans += 1
    else:
        substrs.append(((j == 0) or (i == n + 1), i - j - 1, left))

substrs.sort()
#print(ans)
#print(arr)
#print(substrs)
#print(odd, even)

for l, i, j in substrs:
    if j == 0:
        if even >= i:
            even -= i
        else:
            ans += 2 - l
    else:
        if odd >= i:
            odd -= i
        else:
            ans += 2 - l

print(ans)

```