#Lutece3228. 矩阵翻转

矩阵翻转

Migrated from Lutece 3228 矩阵翻转

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给出一个 n×mn\times m0101 矩阵,即矩阵的所有元 eij{0,1}e_{ij}\in\{0,1\}

每次操作可以将一行或一列的所有元取反,操作可以执行任意次。

求最终矩阵至少有多少个 11

Input

第一行,两个正整数 nnmm

接下来 nn 行,每行 mm 个整数,表示初始矩阵。

Output

一行,一个整数,表示答案。

Samples

3 3
001
011
010
2

Constraints

1n20,1m1051\leq n\leq 20,1\leq m\leq 10^5

Resources

2024 UESTC ICPC Training for Math