#include <bits/stdc++.h>
const int N = 40;
int b[N][N];
int board[N][N];
void flipCol(int col, int x) {
  for (int i = 0; i < x; i++) board[i][col] *= (-1);
  for (int i = 0; i < x; i++) board[i][col + x] *= (-1);
}
void handle(int col, int x, int n) {
  int t1 = 0;
  for (int i = 0; i < x - 1; i++) {
    int sum = board[i][col] + board[i][col + x] + board[i + x][col] +
              board[i + x][col + x];
    if (sum < 0) sum *= -1;
    t1 += sum;
  }
  t1 += board[x - 1][col] + board[x - 1][col + x];
  int t2 = 0;
  flipCol(col, x);
  for (int i = 0; i < x - 1; i++) {
    int sum = board[i][col] + board[i][col + x] + board[i + x][col] +
              board[i + x][col + x];
    if (sum < 0) sum *= -1;
    t2 += sum;
  }
  t2 += board[x - 1][col] + board[x - 1][col + x];
  if (t1 > t2) flipCol(col, x);
  for (int i = 0; i < x - 1; i++) {
    int sum = board[i][col] + board[i][col + x] + board[i + x][col] +
              board[i + x][col + x];
    if (sum < 0) {
      board[i][col] *= (-1);
      board[i + x][col] *= (-1);
      board[i][col + x] *= (-1);
      board[i + x][col + x] *= (-1);
    }
  }
}
void flip(int offset, int x) {
  for (int i = 0; i < x; i++)
    for (int j = 0; j < x; j++) board[i + offset][j] *= (-1);
}
int calc(int n) {
  int total = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) total += board[i][j];
  return total;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) scanf("%d", &b[i][j]);
  int x = (n + 1) / 2;
  int ans = 0;
  for (int z = 0; z < (1 << x); z++) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) board[i][j] = b[i][j];
    for (int i = 0; i <= x - 1; i++)
      if (z & (1 << i)) flip(i, x);
    for (int i = 0; i < x - 1; i++) handle(i, x, n);
    ans = std::max(ans, calc(n));
  }
  printf("%d\n", ans);
}
