#include <bits/stdc++.h>
using namespace std;
int a[35][35];
int r[] = {1, -1};
int b[35];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) scanf("%d", &a[i][j]);
  }
  int ans = -0x3f3f3f3f;
  int k = (n + 1) / 2;
  for (int i = 0; i < 1 << k; i++) {
    int res = 0;
    for (int j = 0; j < k; j++) {
      if ((((i) >> (j)) & 1)) {
        res += a[k - 1][j] * -1;
        b[j] = -1;
      } else {
        res += a[k - 1][j];
        b[j] = 1;
      }
    }
    for (int j = 0; j < k - 1; j++) {
      res += a[k - 1][j + k] * b[k - 1] * b[j];
      b[j + k] = b[k - 1] * b[j];
    }
    for (int j = 0; j < k - 1; j++) {
      int val = -0x3f3f3f3f;
      for (int t = 0; t < 2; t++) {
        int sum = a[j][k - 1] * r[t] + a[k + j][k - 1] * b[k - 1] * r[t];
        for (int L = 0; L < k - 1; L++) {
          sum += abs(a[j][L] + r[t] * a[j][L + k] + a[k + j][L] * b[L] +
                     a[k + j][k + L] * b[k + L] * r[t]);
        }
        val = max(val, sum);
      }
      res += val;
    }
    ans = max(ans, res);
  }
  printf("%d\n", ans);
  return 0;
}
