#include <bits/stdc++.h>
using namespace std;
int n, a[41][41], x, ans = -2147483647;
bool c[41][41];
int v(int x, int y) {
  if (c[x][y]) return -a[x][y];
  return a[x][y];
}
int force(int t) {
  int ret = 0;
  for (int i = 1; i < x; i++) {
    c[i][t] = true;
    c[i + x][t] = c[i][t] ^ c[x][t];
    c[i][t + x] = c[i][t] ^ c[i][x];
    c[i + x][t + x] = c[i][t + x] ^ c[x][t + x];
    int d1 = v(i, t) + v(i + x, t) + v(i, t + x) + v(i + x, t + x);
    if (d1 >= 0) {
      ret += d1;
      continue;
    }
    ret -= d1;
    c[i][t] ^= 1;
    c[i + x][t] ^= 1;
    c[i][t + x] ^= 1;
    c[i + x][t + x] ^= 1;
  }
  return ret;
}
int getans() {
  int ret = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) ret += v(i, j);
  return ret;
}
int main() {
  scanf("%d", &n);
  x = (n + 1) / 2;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%d", &a[i][j]);
  for (int i = 0; i < (1 << x); i++) {
    int tp = 0;
    for (int j = 0; j < x; j++) {
      c[j + 1][x] = i >> j & 1;
      tp += v(j + 1, x);
    }
    for (int j = x + 1; j <= n; j++) {
      c[j][x] = c[j - x][x] ^ c[x][x];
      tp += v(j, x);
    }
    for (int j = 1; j < x; j++) {
      c[x][j] = true;
      c[x][j + x] = c[x][j] ^ c[x][x];
      int t1 = force(j) + v(x, j) + v(x, j + x);
      c[x][j] = false;
      c[x][j + x] ^= 1;
      int t2 = force(j) + v(x, j) + v(x, j + x);
      if (t1 > t2) {
        tp += t1;
        c[x][j] = true;
        c[x][j + x] ^= 1;
        force(j);
      } else
        tp += t2;
    }
    ans = max(ans, tp);
  }
  printf("%d\n", ans);
}
