import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Sample135 {
	public final int row;
	public final int col;

	private final boolean[][] initMatrix;
	private int rowCount = 0;

	public Sample135(int r, int c) {
		row = r;
		col = c;
		initMatrix = new boolean[r][];
	}
	public void setRow(int[] row) {
		initMatrix[rowCount] = new boolean[col];
		int index = 0;
		for (int cell: row) {
			initMatrix[rowCount][index++] = (cell == 0);
		}
		rowCount++;
	}
	public int calc() {
		int max = 0;
		// 行単位で、反転・そのままの全てのパターンを作成する
		List<boolean[][]> pattern = new ArrayList<boolean[][]>();
		pattern.add(initMatrix);
		for (int index = 0; index < row; index++) {
			List<boolean[][]> work = new ArrayList<boolean[][]>();
			for (boolean[][] matrix: pattern) {
				work.add(reverseRow(matrix, index));
			}
			pattern.addAll(work);
		}
		// 各パターンで、列単位でtrueが多い場合のpointを計算
		for (boolean[][] matrix: pattern) {
			int point = calcMaxPoint(matrix);
			if (max < point) max = point;
		}
		return max;
	}
	private boolean[][] reverseRow(boolean[][] matrix, int rIndex) {
		boolean[][] result = new boolean[row][];
		for (int index = 0; index < row; index++) {
			result[index] = copyRow(matrix[index], index == rIndex);
		}
		return result;
	}
	private boolean[] copyRow(boolean[] row, boolean reverse) {
		boolean[] result = new boolean[row.length];
		int index = 0;
		for (boolean b: row) {
			result[index++] = reverse? !b: b;
		}
		return result;
	}

	private int calcMaxPoint(boolean[][] matrix) {
		int sum = 0;
		for (int index = 0; index < col; index++) {
			int point = 0;
			for (boolean[] row: matrix) {
				if (row[index]) point++;
			}
			if (point <= row / 2) point = row - point;
			sum += point;
		}
		return sum;
	}


	private static int[] toIntArray(String[] input) {
		int[] result = new int[input.length];
		int index = 0;
		for (String s: input) {
			result[index++] = Integer.parseInt(s);
		}
		return result;
	}

	public static void main(String[] args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			String[] table = reader.readLine().split("\\s");
			int r = Integer.parseInt(table[0]);
			int c = Integer.parseInt(table[1]);
			Sample135 sample = new Sample135(r, c);
			for (int index = 0; index < r; index++) {
				sample.setRow(toIntArray(reader.readLine().split("\\s")));
			}
			int result = sample.calc();
			System.out.println(result);
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
}
