#include <bits/stdc++.h>
using namespace std;
int s[50][50], ss[50][50];
int main(void) {
  int n;
  scanf("%d", &n);
  int i, j, d, k, jj;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) scanf("%d", &s[i][j]);
  int x = (n + 1) / 2;
  int ans = 0;
  for (d = 0; d < (1 << (x)); d++) {
    int i;
    int sum2 = 0;
    for (i = 0; i < x; i++) {
      ss[i][x - 1] = (1 << i) & d ? 1 : 0;
      sum2 += ss[i][x - 1] == 1 ? -s[i][x - 1] : s[i][x - 1];
    }
    for (i = x; i < n; i++) {
      ss[i][x - 1] = ss[i - x][x - 1] + ss[x - 1][x - 1] == 1 ? 1 : 0;
      sum2 += ss[i][x - 1] == 1 ? -s[i][x - 1] : s[i][x - 1];
    }
    for (i = 0; i < x - 1; i++) {
      int max2 = 0;
      for (j = 0; j <= 1; j++) {
        int sum1 = 0;
        ss[x - 1][i] = j == 1 ? 1 : 0;
        ss[x - 1][i + x] = ss[x - 1][i] + ss[x - 1][x - 1] == 1 ? 1 : 0;
        sum1 += ss[x - 1][i] == 1 ? -s[x - 1][i] : s[x - 1][i];
        sum1 += ss[x - 1][i + x] == 1 ? -s[x - 1][i + x] : s[x - 1][i + x];
        for (k = 0; k < x - 1; k++) {
          int max1 = 0;
          for (jj = 0; jj <= 1; jj++) {
            int tot1 = 0;
            ss[k][i] = jj == 1 ? 1 : 0;
            ss[k + x][i] = ss[k][i] + ss[x - 1][i] == 1 ? 1 : 0;
            ss[k][i + x] = ss[k][i] + ss[k][x - 1] == 1 ? 1 : 0;
            ss[k + x][i + x] = ss[k + x][i] + ss[k + x][x - 1] == 1 ? 1 : 0;
            tot1 += ss[k][i] == 1 ? -s[k][i] : s[k][i];
            tot1 += ss[k + x][i] == 1 ? -s[k + x][i] : s[k + x][i];
            tot1 += ss[k][i + x] == 1 ? -s[k][i + x] : s[k][i + x];
            tot1 += ss[k + x][i + x] == 1 ? -s[k + x][i + x] : s[k + x][i + x];
            max1 = max(max1, tot1);
          }
          sum1 += max1;
        }
        max2 = max(max2, sum1);
      }
      sum2 += max2;
    }
    ans = max(ans, sum2);
  }
  printf("%d\n", ans);
  return 0;
}
