You are given a matrix A containing N×M elements. You are required to find the number of rectangular submatrices of this matrix such that the sum of the elements in each such submatrix is even.
Input format
Output format
Print a number denoting the number of rectangular submatrices, the sum of the elements of each is even.
Constraints
1≤N,M≤2000
1≤Ai,j≤109, 1≤i≤N,1≤j≤M
The following sub-matrices are suitable for us:
(2), (4),(6),(1,2,3)
(1,24,5), (2,35,6)
Count submatrices = 6.