Question
Even Sum Pairs
You are given an array of KaTeX can only parse string typed expression integers. Your task is to count the number of pairs KaTeX can only parse string typed expression such that KaTeX can only parse string typed expression and the sum of the two elements is even.
Input
The first line contains a single integer KaTeX can only parse string typed expression — the size of the array.
The second line contains KaTeX can only parse string typed expression integers, representing the elements of the array - KaTeX can only parse string typed expression.
The second line contains KaTeX can only parse string typed expression integers, representing the elements of the array - KaTeX can only parse string typed expression.
Output
Print a single integer — the number of pairs KaTeX can only parse string typed expression with KaTeX can only parse string typed expression such that KaTeX can only parse string typed expression is even.
Example
Input
5
1 2 3 4 5
Output
4
Explanation
Valid pairs with even sum:
(0, 2) → 1 + 3 = 4
(0, 4) → 1 + 5 = 6
(1, 3) → 2 + 4 = 6
(2, 4) → 3 + 5 = 8
Total = 4 pairs.
5
1 2 3 4 5
Output
4
Explanation
Valid pairs with even sum:
(0, 2) → 1 + 3 = 4
(0, 4) → 1 + 5 = 6
(1, 3) → 2 + 4 = 6
(2, 4) → 3 + 5 = 8
Total = 4 pairs.