#include <bits/stdc++.h>
using namespace std;
char buf[1 << 20], *p1, *p2;
template <class T>
inline void read(T &n) {
  char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
           ? 0
           : *p1++);
  T w = 1, x = 0;
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
             ? 0
             : *p1++);
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
             ? 0
             : *p1++);
  }
  n = x * w;
}
const int maxn = 40;
int v[maxn][maxn], z[maxn][maxn], n, m, ans;
inline int get(int i, int j) { return z[i][j] ? -v[i][j] : v[i][j]; }
inline int solve2(int i, int j, int dd) {
  z[i][j] = dd;
  z[i][j + m] = z[i][j] ^ z[i][m];
  z[i + m][j] = z[i][j] ^ z[m][j];
  z[i + m][j + m] = z[i + m][j] ^ z[i + m][m];
  return get(i, j) + get(i + m, j) + get(i, j + m) + get(i + m, j + m);
}
inline int solve1(int i, int dd) {
  z[i][m] = dd;
  z[i + m][m] = z[m][m] ^ dd;
  int ans = get(i, m) + get(i + m, m);
  for (int j = 1; j < m; j++) ans += max(solve2(i, j, 0), solve2(i, j, 1));
  return ans;
}
int main() {
  read(n);
  m = (n + 1) / 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      read(v[i][j]);
    }
  }
  int Ans = 0;
  for (int s = 0; s < (1 << m); s++) {
    ans = 0;
    for (int i = m; i >= 1; i--) {
      z[m][i] = (s >> i - 1) & 1;
      if (i < m) z[m][i + m] = z[m][m] ^ z[m][i];
    }
    for (int i = 1; i <= n; i++) ans += get(m, i);
    for (int i = 1; i < m; i++) ans += max(solve1(i, 0), solve1(i, 1));
    Ans = max(Ans, ans);
  }
  cout << Ans;
  return 0;
}
