#864
Gold II
IVANA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Even though she saw Zvonko steal Mirko's microprocessor in the second task, Mirko's sister Ivana did not tell Mirko because she likes Zvonko. She suggested to him that they go see a movie together so that she would "forget" about the incident.

Zvonko does not care much for girls because they take away precious time he usually spends practicing his math-fu. He suggested that the two of them play a game and, if Ivana wins, they will go see a movie together. Ivana agreed, being good at jump rope and she sometimes even kicks a football around with her two brothers.

Zvonko laid NN positive integers in a circle on the floor and explained the rules:

  • The first player takes any number.
  • The second player takes either of the two numbers adjacent to the one the first player took.
  • The next player takes a number adjacent to any of the numbers taken so far, and so on until they run out of numbers. The player to take more odd numbers (not divisible by 2) wins.

Zvonko plays optimally; he always looks for a strategy that leads to certain victory or a draw. Zvonko does not know how well Ivana plays. Being a true cavalier, he let Ivana have the first move.

But Ivana only cares about sitting next to Zvonko in front of the big screen so she seeks help playing. Write a program that finds how many different first moves Ivana can make, so that she has a chance of winning afterwards.

입력

The first line of input contains an integer NN (1N1001 \le N \le 100), how many numbers there are in the circle.

The second line contains NN integers separated by single spaces. All numbers will be between 11 and 10001000 (inclusive). No two numbers will be the same.

출력

Output the desired number on a single line.

예제 입력 1

3
3 1 5

예제 출력 1

3

예제 입력 2

4
1 2 3 4

예제 출력 2

2

예제 입력 3

8
4 10 5 2 9 8 1 7

예제 출력 3

5
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Gold II1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.