#include <bits/stdc++.h>
using namespace std;
const int N = 34;
int board[N][N];
int a[N][N];
int x, n;
void print_b() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", board[i][j]);
    }
    puts("");
  }
  puts("----");
}
void flip_board(int start) {
  int e = start + x;
  for (int i = start; i < e; i++) {
    for (int j = 0; j < x; j++) {
      board[i][j] *= -1;
    }
  }
}
void flip_row(int r1, int r2, int offset) {
  int e = offset + x;
  for (int i = offset; i < e; i++) {
    board[r1][i] *= -1;
    board[r2][i] *= -1;
  }
}
void flip_col(int c1) {
  int c2 = c1 + x;
  for (int i = 0; i < x; i++) {
    board[i][c1] *= -1;
    board[i][c2] *= -1;
  }
}
int calc(int c1) {
  int c2 = c1 + x;
  int res1 = 0;
  res1 += board[x - 1][c1] + board[x - 1][c2];
  for (int i = 0; i < x - 1; i++) {
    res1 +=
        abs(board[i][c1] + board[i][c2] + board[i + x][c1] + board[i + x][c2]);
  }
  int res2 = 0;
  flip_col(c1);
  res2 += board[x - 1][c1] + board[x - 1][c2];
  for (int i = 0; i < x - 1; i++) {
    res2 +=
        abs(board[i][c1] + board[i][c2] + board[i + x][c1] + board[i + x][c2]);
  }
  return max(res1, res2);
}
void flip(int bits) {
  int level = 0;
  while (bits) {
    if (bits & 1) {
      if (level == 0)
        flip_board(level);
      else
        flip_row(level - 1, level - 1 + x, 0);
    }
    level++;
    bits >>= 1;
  }
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    x = (n + 1) / 2;
    int ans = -(1 << 30);
    for (int i = 0; i < (1 << x); i++) {
      int res = 0;
      memcpy(board, a, sizeof(a));
      flip(i);
      for (int r = 0; r < n; r++) {
        res += board[r][x - 1];
      }
      for (int c = 0; c < x - 1; c++) {
        res += calc(c);
      }
      ans = max(ans, res);
    }
    printf("%d\n", ans);
  }
}
