#include <bits/stdc++.h>
using namespace std;
const int N = 35;
int n, m, ans;
int a[N][N], f[N][N];
void solve() {
  int sum = 0;
  for (int i = (int)(1); i <= (int)(m - 1); i++)
    f[m][i + m] = f[m][i] * f[m][m];
  for (int i = (int)(1); i <= (int)(n); i++) sum += f[m][i] * a[m][i];
  for (int i = (int)(1); i <= (int)(m - 1); i++) {
    int v0 = 0, v1 = 0;
    v0 += a[i][m] + f[m][m] * a[i + m][m];
    v1 -= a[i][m] + f[m][m] * a[i + m][m];
    for (int j = (int)(1); j <= (int)(m - 1); j++) {
      int val = 0;
      val += a[i][j];
      val += a[i][j + m];
      val += a[i + m][j] * f[m][j];
      val += a[i + m][j + m] * f[m][j + m];
      v0 += abs(val);
      val = 0;
      val += a[i][j];
      val -= a[i][j + m];
      val += a[i + m][j] * f[m][j];
      val -= a[i + m][j + m] * f[m][j + m];
      v1 += abs(val);
    }
    sum += max(v0, v1);
  }
  ans = max(ans, sum);
}
void dfs(int x) {
  if (x > m) return solve();
  f[m][x] = 1;
  dfs(x + 1);
  f[m][x] = -1;
  dfs(x + 1);
}
int main() {
  scanf("%d", &n);
  m = (n + 1) / 2;
  ans = -(1 << 30);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(n); j++) scanf("%d", &a[i][j]);
  dfs(1);
  printf("%d\n", ans);
}
