1768 - [Ceoi2009]logs

有一个N*M的01矩阵,现在你可以的任意交换其中的列,要求找一个最大的仅由1组成的矩阵。 N<=15000,M<=1500 1 ≤ N ≤ 15000 1 ≤ M ≤ 1500 30% of the test cases will have N,M ≤ 1024

Input

N,M 以下N行每行M个字符。

Output

Examples

Input

10 6 
001010 
111110 
011110 
111110 
011110 
111111 
110111 
110111 
000101 
010101 

Output

21

Hint

By permuting the columns such that columns 2, 4 and 5 are adjacent you have a rectangle of area 21 (rows 2-8 and columns 2, 4, 5).

Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题