P6457 [COCI 2006/2007 #5] IVANA
Description
Given $n$ integers arranged in a circle, two players take numbers according to the following rules:
- The player who takes first may take any number.
- The player who takes second may only take one of the two numbers adjacent (left or right) to the number taken in the previous move.
- The player who takes third may take one of the two numbers adjacent (left or right) to any number that has been taken before.
Here, the first number and the $n$-th number are adjacent to only one number.
The two players take turns. After all numbers have been taken, the player who has taken more odd numbers wins.
Find how many different opening moves the first player has such that they can win the game.
Input Format
The first line contains an integer $n$, the number of integers.
The second line contains $n$ integers, the values of the numbers.
Output Format
Output one integer on one line, the number of opening moves with which the first player wins the game.
Explanation/Hint
#### Constraints
For $100\%$ of the testdata, $1 \le n \le 100$, and each input number is between $1$ and $1000$.
#### Notes
**This problem is translated from [COCI2006-2007](https://hsin.hr/coci/archive/2006_2007/) [CONTEST #5](https://hsin.hr/coci/archive/2006_2007/contest5_tasks.pdf) *T5 IVANA***.
Translated by ChatGPT 5