#include <bits/stdc++.h>
using namespace std;
const int N = 50;
int a[N][N], n, len;
bool b[N];
int chk(int i, int j, int s, int p, int q, int r) {
  int sum = (s ? -1 : 1) * a[i][j];
  sum += (s ^ p ? -1 : 1) * a[i][j + len];
  sum += (s ^ r ? -1 : 1) * a[i + len][j];
  sum += (s ^ r ^ q ? -1 : 1) * a[i + len][j + len];
  return sum;
}
int chk(int j, int p, int q) {
  int sum = 0;
  sum += (p ? -1 : 1) * a[len - 1][j];
  sum += (q ? -1 : 1) * a[len - 1][j + len];
  for (int i = 0; i < len - 1; i++) {
    int val1 = chk(i, j, 0, b[i], b[len + i], p);
    int val2 = chk(i, j, 1, b[i], b[len + i], p);
    sum += max(val1, val2);
  }
  return sum;
}
int main() {
  cin >> n;
  len = n / 2 + 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  int ans = 0;
  for (int msk = 0; msk < (1 << len); msk++) {
    int sum = 0;
    for (int i = 0; i < len; i++) b[i] = (1 << i & msk);
    for (int i = len; i < n; i++) b[i] = b[len - 1] ^ b[i - len];
    for (int i = 0; i < n; i++) sum += (b[i] ? -1 : 1) * a[i][len - 1];
    for (int j = 0; j < len - 1; j++) {
      int val1 = chk(j, 0, b[len - 1]);
      int val2 = chk(j, 1, !b[len - 1]);
      sum += max(val1, val2);
    }
    ans = max(sum, ans);
  }
  cout << ans << endl;
}
