is going through a stressful week; It is yet another week of midterms, this time at university.
Unable to invest any more time into writing problems for the DMOPC,
has offered you a position among the problemsetters of this DMCI-based contest, provided that you correctly answer the following skill-testing question:Given an array
of integers, count the number of elements which share the parity of its index ( -based).
More colloquially, find the number of array elements which have the same remainder when divided by
Input Specification
The first line of the input contains the integer
The next line of the input contains
Output Specification
Your program should output the number of array elements which have the same parity as its index on a single line by itself.
Sample Input
Copy
5
0 1 2 3 4
Sample Output
Copy
5
Explanation
All of the array elements are the same as their indices, so the answer is
Comments