#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 (x) return -y;
  return y;
}
int force(int t) {
  int ret = 0;
  for (int i = 1; i < x; i++) {
    int d1 = v(0, a[i][t]) + v(c[x][t], a[i + x][t]) + v(c[i][x], a[i][t + x]) +
             v(c[i][x] ^ c[x][t + x], a[i + x][t + x]);
    if (d1 >= 0)
      ret += d1;
    else
      ret -= d1;
  }
  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(c[j + 1][x], a[j + 1][x]);
    }
    for (int j = x + 1; j <= n; j++) {
      c[j][x] = c[j - x][x] ^ c[x][x];
      tp += v(c[j][x], a[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(1, a[x][j]) + v(c[x][j + x], a[x][j + x]);
      c[x][j] = false;
      c[x][j + x] ^= 1;
      int t2 = force(j) + v(0, a[x][j]) + v(c[x][j + x], a[x][j + x]);
      if (t1 > t2)
        tp += t1;
      else
        tp += t2;
    }
    ans = max(ans, tp);
  }
  printf("%d\n", ans);
}
