program flip;
type matrice = array[1..16,1..16] of longint;
var m, n, i, j:integer;
a :matrice;
f :text;
max :longint;
procedure citire;
begin
assign(f,'flip.in');
reset(f);
readln(f,m,n);
for i := 1 to m do
begin
for j := 1 to n do
read(f,a[i,j]);
readln(f);
end;
close(f);
end;
function sum_lin_col(x, y:integer):longint;
var i:integer;
begin
sum_lin_col := 0 ;
for i := 1 to m do
sum_lin_col := sum_lin_col + a[i,y];
for i := 1 to n do
sum_lin_col := sum_lin_col + a[x,i];
end;
procedure chg_lin(x :integer);
var i :integer;
begin
for i := 1 to n do
a[x,i] := a[x,i] * (-1);
end;
procedure chg_col(x :integer);
var i :integer;
begin
for i := 1 to m do
a[i,x] := a[i,x] * (-1);
end;
function sum:longint;
var i, j :integer;
begin
sum:=0;
for i := 1 to m do
for j := 1 to n do
sum := sum + a[i,j];
end;
begin
citire;
for i := 1 to m do
for j := 1 to n do
begin
max := sum_lin_col(i,j);
chg_lin(i);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_lin(i);
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_col(j);
chg_lin(i);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_lin(i);
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_lin(i);
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_col(j);
chg_lin(i);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_lin(i);
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_lin(i);
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_col(j);
chg_lin(i);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_lin(i);
chg_col(j);
if max < sum_lin_col(i,j) then
max := sum_lin_col(i,j)
else
chg_col(j);
end;
assign(f,'flip.out');
rewrite(f);
write(f,sum());
close(f);
end.