var
  f: Text;
  C: array [1..20, 1..20] of Integer;
  i, j, N: Integer;
  b, bestb: Longint;
  A, bestA: array [1..20] of Boolean;

procedure Rec(i: Integer);
var
  j: Integer;
  b1: Longint;
begin
  if i > N then begin
    if b > bestb then begin bestb := b; bestA := A; end;
    exit;
  end;
  A[i] := true;
  b1 := b;
  for j := 1 to N do
    if A[j] then Dec(b, C[i, j]) else Inc(b, C[i, j]);
  Rec(i + 1);
  b := b1;
  A[i] := false;
  Rec(i + 1);
end;

begin
//  Assign(f, 'input.txt'); Reset(f);
  Readln(N);
  for i := 1 to N do
    for j := 1 to N do
      Read(C[i, j]);
//  Close(f);
  b := 0; bestb := 0;
  Rec(2);
//  Assign(f, 'output.txt'); Rewrite(f);
  Writeln(bestb);
  {for i := 1 to N do
    Write(Ord(bestA[i]), ' ');
  Writeln;}
//  Close(f);
end.
