import std.stdio, std.array, std.algorithm, std.conv, core.bitop, std.string;

void main(){
	int h, w;
		for(;scanf("%d%d ", &h, &w), h;){
		auto board = new int[][](h);
		foreach(ref line; board){
			line = array(map!(to!int)(readln.chomp.split));
		}

		auto vert = new int[](w);
		foreach(i; 0..h){
			foreach(j; 0..w){
				vert[j] |= board[i][j]<<i;
			}
		}

		int ans = 0;
		foreach(bit; 0..1<<h){
			ans = max(ans, reduce!((int a, int b){return a + max(popcnt(b^bit), h - popcnt(b^bit));})(0, vert));
		}

		writeln(ans);
	}
}