#include <bits/stdc++.h>
using namespace std;
int N, X, Num[34][34];
int S, Ans[1 << 17], C[34];
int F[2] = {1, -1};
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= N; ++j) scanf("%d", &Num[i][j]);
  X = (N + 1) >> 1;
  S = 1 << X;
  for (int s = 0; s < S; ++s) {
    memset(C, 0, sizeof(C));
    for (int ss = s, n = 1; ss; ss >>= 1, ++n) C[n] = ss & 1;
    for (int n = X + 1; n <= N; ++n) C[n] = C[n - X] ^ C[X];
    int ans = 0;
    for (int n = 1; n <= N; ++n) ans += Num[X][n] * F[C[n]];
    for (int i = 1; i < X; ++i) {
      int Add = -1111111;
      for (int k = 0; k <= 1; ++k) {
        int add = F[k] * Num[i][X] + F[C[X] ^ k] * Num[i + X][X];
        for (int j = 1; j < X; ++j) {
          int newadd = -1111111;
          int a, b, c, d;
          for (int a = 0; a <= 1; ++a) {
            b = a ^ k;
            c = a ^ C[j];
            d = b ^ C[j + X];
            newadd = max(newadd, F[a] * Num[i][j] + F[b] * Num[i][j + X] +
                                     F[c] * Num[i + X][j] +
                                     F[d] * Num[i + X][j + X]);
          }
          for (int a = 0; a <= 1; ++a) {
            b = a ^ k;
            c = a ^ C[j];
            d = b ^ C[j + X];
            newadd = max(newadd, F[a] * Num[i][j] + F[b] * Num[i][j + X] +
                                     F[c] * Num[i + X][j] +
                                     F[d] * Num[i + X][j + X]);
          }
          add += newadd;
        }
        Add = max(Add, add);
      }
      ans += Add;
    }
    Ans[s] = ans;
  }
  for (int s = 1; s < S; ++s) Ans[0] = max(Ans[0], Ans[s]);
  printf("%d\n", Ans[0]);
  return 0;
}
