#GD0000013. Đưa tích về một (Make Product Equal One)

Đưa tích về một (Make Product Equal One)

Make Product Equal One

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given nn integers aia_i, one operation costs 11 and increments or decrements one element by 11. Find the minimum total cost to make the product of all elements equal to 11.

Input

The first line contains nn. The second line contains nn integers aia_i.

Output

Print the minimum cost.

Subtasks

General constraints:

  • 1≤n≤1051 \le n \le 10^5.

  • −109≤ai≤109-10^9 \le a_i \le 10^9.

  • Subtask 1 (20 points): n≤20n \le 20, ∣ai∣≤20|a_i| \le 20

  • Subtask 2 (30 points): n≤5000n \le 5000, ∣ai∣≤106|a_i| \le 10^6

  • Subtask 3 (50 points): No additional constraints.

Examples

Input

5
-5 -3 5 3 0

Output

13

Explanation

Move −5→−1-5\to-1 for cost 44, −3→−1-3\to-1 for 22, 5→15\to1 for 44, 3→13\to1 for 22, and 0→10\to1 for 11. Total cost is 1313, and the two negative values make the product positive.