type ma=array [1..16,1..16] of longint;
ta=array [1..16] of -1..1;
var n,m,i,j:longint;
smax:longint;
a:ma;
sol:ta;
f:text;
procedure evaluare;
var i,j,s,sc:longint;
begin
s:=0;
for i:=1 to m do
begin
sc:=a[1,i];
for j:=2 to n do
sc:=sc+sol[j]*a[j,i];
s:=s+abs(sc);
end;
if smax<s then smax:=s;
end;
procedure back(p:integer);
begin
sol[p]:=1;
if p=n then evaluare
else back(p+1);
sol[p]:=-1;
if p=n then evaluare
else back(p+1);
end;
begin
assign(f,'flip.in');reset(f);
readln(f,n,m);
for i:=1 to n do
begin
for j:=1 to m do
read (f,a[i,j]);
readln(f);
end;
close(f);
smax:=0;
back(1);
assign(f,'flip.out');rewrite(f);
write(f,smax);
close(f);
end.
type ma=array [1..16,1..16] of longint;
ta=array [1..16] of -1..1;
var n,m,i,j:longint;
smax:longint;
a:ma;
sol:ta;
f:text;
procedure evaluare;
var i,j,s,sc:longint;
begin
s:=0;
for i:=1 to m do
begin
sc:=a[1,i];
for j:=2 to n do
sc:=sc+sol[j]*a[j,i];
s:=s+abs(sc);
end;
if smax<s then smax:=s;
end;
procedure back(p:integer);
begin
sol[p]:=1;
if p=n then evaluare
else back(p+1);
sol[p]:=-1;
if p=n then evaluare
else back(p+1);
end;
begin
assign(f,'flip.in');reset(f);
readln(f,n,m);
for i:=1 to n do
begin
for j:=1 to m do
//uses timer;
var phi:array[0..500000] of longword;
i,j,k,n:longint;
procedure smart; inline;
var i,j,doi,jum:longint;
rez:qword;
k:longword;
begin
rez:=1; jum:=n div 2;
for i:=2 to jum do phi[i]:=i-1;
for i:=2 to jum do
begin
k:=phi[i]; doi:=2*i;
j:=3*i;
while (j<=jum) do
begin
dec(phi[j], k);
inc(j, doi);
end;
while (j<=n) do
begin
dec(rez, k); inc(j, doi);
end;
end;
rez:=rez+int64(n-1)*n div 2-int64(jum-1)*jum div 2;
writeln(2*rez-1);
end;
begin
//start;
assign(input,'fractii.in'); reset(input);
assign(output,'fractii.out'); rewrite(output);
readln(n);
smart;
//scurs;
close(input); close(output);
end.
//uses timer;
var phi:array[0..500000] of longword;
i,j,k,n:longint;
procedure smart; inline;
var i,j,doi,jum:longint;
rez:qword;
k:longword;
begin
rez:=1; jum:=n div 2;
for i:=2 to jum do phi[i]:=i-1;
for i:=2 to jum do
begin
k:=phi[i]; doi:=2*i;
j:=3*i;
while (j<=jum) do
begin
dec(phi[j], k);
inc(j, doi);
end;
while (j<=n) do
begin
dec(rez, k); inc(j, doi);
end;
end;
rez:=rez+int64(n-1)*n div 2-int64(jum-1)*jum div 2;
writeln(2*rez-1);
end;
begin
//start;
assign(input,'fractii.in'); reset(input);
assign(output,'fractii.out'); rewrite(output);
readln(n);
smart;
//scurs;
close(input); close(output);
end.