#include <bits/stdc++.h>
using namespace std;
int n, m;
int sol, rez, sum1, sum2;
int v[35][35];
int sg[35], a[35];
int main() {
  cin >> n;
  m = (n + 1) / 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cin >> v[i][j];
  }
  for (int i = 0; i < (1 << m); i++) {
    rez = 0;
    for (int j = m; j >= 1; j--) {
      if ((i >> (j - 1)) & 1)
        sg[j] = -1;
      else
        sg[j] = 1;
      sg[j + m] = sg[j] * sg[m];
      rez += v[j][m] * sg[j] + v[j + m][m] * sg[j + m];
    }
    for (int j = 1; j < m; j++) {
      for (int k = 1; k <= n; k++) a[k] = v[k][j] + sg[k] * v[k][j + m];
      sum1 = sum2 = 0;
      for (int k = 1; k < m; k++) {
        sum1 += abs(a[k] + a[k + m]);
        sum2 += abs(a[k] - a[k + m]);
      }
      rez += max(sum1 + a[m], sum2 - a[m]);
    }
    sol = max(sol, rez);
  }
  cout << sol;
  return 0;
}
