class Solution(object):
def oddCells(self, m, n, indices):
"""
:type m: int
:type n: int
:type indices: List[List[int]]
:rtype: int
"""
r = [0 for _ in range(m)]
c = [0 for _ in range(n)]
for cur_r, cur_c in indices:
r[cur_r] += 1
c[cur_c] += 1
return sum((cur_r + cur_c) % 2 for cur_r in r for cur_c in c)