Victory

Time limit1sMemory limit128 MB

Problem

Two players play a game with N positive integers written in order on a circle. Sunyoung moves first and chooses one number. If any numbers remain, Jeongin chooses one of the two numbers adjacent to Sunyoung's choice. After that, the chosen numbers always form one consecutive block on the circle, and the next player chooses one of the still-unpicked numbers adjacent to either end of that block. When no number can be chosen, the game ends.

Each player counts how many odd numbers they chose. The player who chose more odd numbers wins. Jeongin plays optimally, and if he has a strategy that lets him win or draw, he chooses such a strategy.

Count how many possible first choices let Sunyoung win even when Jeongin plays optimally.

Input

The first line contains the number N of integers on the circle. (1 <= N <= 100)

The second line contains N distinct integers separated by spaces. Each integer is between 1 and 1000, inclusive.

Output

Print the number of first choices that guarantee Sunyoung's victory.