In a bustling town, a clever student named Maya received a challenge from her teacher. She was presented with an array of integers, A, containing N elements. Her task was to transform the array into a “strong” array, defined as one where the sum of its elements is odd.
However, Maya could only achieve this by performing a specific operation: she could remove the last element from the array as many times as necessary. Determined to rise to the occasion, Maya set off on her journey to find the minimum number of moves required to make her array strong. Yet, she was also aware that there might be a chance that making the array strong was impossible.
Can you help Maya determine the minimum moves needed to achieve her goal, or print -1 if it’s simply not possible?
The second line of the input contains N space-separated integers.
Constraints
1 ≤ N ≤ 105
1 ≤ Ai ≤ 109
5
5 9 7 6 3
Sample Output
1
Explaination
We just have to remove one element from the last.