#include<iostream>

using namespace std;

int map[11][10001],turn[11],r,c,ans;

void serch(int n)
{
	int i,j;
	if(n==r)
	{
		int ss,ssans=0;
		for(i=0;i<c;i++)
		{
			ss=0;
			for(j=0;j<r;j++)
			{
				if(turn[j]==0)
				{
					if(map[j][i]==1)
						ss++;
				}
				else if(turn[j]==1)
				{
					if(map[j][i]==0)
						ss++;
				}
			}
			if(ss<=r/2)
				ssans+=r-ss;
			else
				ssans+=ss;
		}
		if(ans<ssans)
			ans=ssans;
		return ;
	}
	turn[n]=0;
	serch(n+1);
	turn[n]=1;
	serch(n+1);
	return ;
}
int main()
{
	int i,j;
	
	for(;;)
	{
		cin >> r >> c ;
		if(r==0 && c==0)
			break;
		
		for(i=0;i<r;i++)
			for(j=0;j<c;j++)
				cin >> map[i][j] ;
		
		ans=0;
		
		serch(0);
		
		cout << ans << endl;
	}
}