#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[55][55];
int ans = -1e9;
void dfs(int now) {
  if (now + m - 1 > n) {
    int sum = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        sum += a[i][j];
      }
    }
    for (int i = 1; i + m - 1 < n; i++) {
      int maxn1 = 0, maxn2 = 0;
      for (int j = n - m + 2; j <= n; j++) {
        maxn1 += max(
            0, -2 * (a[j][i] + a[j - m][i] + a[j][i + m] + a[j - m][i + m]));
        maxn2 += max(-2 * (a[j][i] + a[j][i + m]),
                     -2 * (a[j - m][i] + a[j - m][i + m]));
      }
      maxn2 += -2 * (a[n - m + 1][i] + a[n - m + 1][i + m]);
      sum += max(maxn1, maxn2);
    }
    ans = max(ans, sum);
    return;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = n - m + 1; j <= n; j++) {
      a[now + i - 1][j] *= -1;
    }
  }
  dfs(now + 1);
  for (int i = 1; i <= m; i++) {
    for (int j = n - m + 1; j <= n; j++) {
      a[now + i - 1][j] *= -1;
    }
  }
  dfs(now + 1);
}
int main() {
  scanf("%d", &n);
  m = (n + 1) / 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  dfs(1);
  printf("%d\n", ans);
  return 0;
}
