#include <bits/stdc++.h>
using namespace std;
int n, D;
const int opt[] = {1, -1};
int g[35][35], M[35];
inline int Get(int i, int T) {
  int ret = g[i][D] * opt[T] + g[i + D][D] * opt[T ^ M[D]];
  for (int j = 1; j < D; j++) {
    int a = 0, b = T, c = M[j], d = T ^ M[D] ^ c;
    ret += max(g[i][j] * opt[a] + g[i][j + D] * opt[b] + g[i + D][j] * opt[c] +
                   g[i + D][j + D] * opt[d],
               g[i][j] * opt[!a] + g[i][j + D] * opt[!b] +
                   g[i + D][j] * opt[!c] + g[i + D][j + D] * opt[!d]);
  }
  return ret;
}
inline int Calc(int S) {
  int ret = 0;
  for (int i = 1; i <= D; i++)
    M[i] = (S >> i - 1) & 1, ret += g[D][i] * opt[M[i]];
  for (int i = D + 1; i <= n; i++)
    M[i] = M[D] ^ M[i - D], ret += g[D][i] * opt[M[i]];
  for (int i = 1; i < D; i++) ret += max(Get(i, 0), Get(i, 1));
  return ret;
}
int main() {
  scanf("%d", &n);
  D = n + 1 >> 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%d", &g[i][j]);
    }
  }
  int Lim = 1 << D, ans = -1e9;
  for (int S = 0; S < Lim; S++) ans = max(ans, Calc(S));
  printf("%d\n", ans);
  return 0;
}
