#include <bits/stdc++.h>
using namespace std;
const int N = 33 + 10;
const int INF = 123456789;
int n, x;
int a[N][N], b[N][N];
int solve2(int j) {
  int ret = 0;
  b[x][j + x] = b[x][x] * b[x][j];
  ret += a[x][j] * b[x][j];
  ret += a[x][j + x] * b[x][j + x];
  for (int i = 1; i < x; i++) {
    int tmp = 0;
    b[i][j] = 1;
    b[i + x][j] = b[x][j] * b[i][j];
    b[i][j + x] = b[i][x] * b[i][j];
    b[i + x][j + x] = b[i + x][x] * b[i + x][j];
    tmp += a[i][j] * b[i][j];
    tmp += a[i + x][j] * b[i + x][j];
    tmp += a[i][j + x] * b[i][j + x];
    tmp += a[i + x][j + x] * b[i + x][j + x];
    ret += abs(tmp);
  }
  return ret;
}
int solve() {
  int ret = 0;
  for (int j = 1; j < x; j++) {
    int tmp = -INF;
    b[x][j] = 1;
    tmp = max(tmp, solve2(j));
    b[x][j] = -1;
    tmp = max(tmp, solve2(j));
    ret += tmp;
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%d", a[i] + j);
  x = (n + 1) / 2;
  int ans = -INF;
  for (int mask = 0; mask < (1 << x); mask++) {
    int tmp = 0;
    for (int i = 1; i <= x; i++) {
      if ((mask >> (i - 1)) & 1)
        b[i][x] = 1;
      else
        b[i][x] = -1;
      tmp += a[i][x] * b[i][x];
    }
    for (int i = x + 1; i <= n; i++) {
      b[i][x] = b[x][x] * b[i - x][x];
      tmp += a[i][x] * b[i][x];
    }
    ans = max(ans, solve() + tmp);
  }
  printf("%d\n", ans);
  return 0;
}
