Fox Ciel has a board with n rows and n columns, there is one integer in each cell.

It's known that n is an odd number, so let's introduce <image>. Fox Ciel can do the following operation many times: she choose a sub-board with size x rows and x columns, then all numbers in it will be multiplied by -1.

Return the maximal sum of numbers in the board that she can get by these operations.

Input

The first line contains an integer n, (1 ≤ n ≤ 33, and n is an odd integer) — the size of the board.

Each of the next n lines contains n integers — the numbers in the board. Each number doesn't exceed 1000 by its absolute value.

Output

Output a single integer: the maximal sum of numbers in the board that can be accomplished.

Examples

Input

3
-1 -1 1
-1 1 -1
1 -1 -1


Output

9


Input

5
-2 0 0 0 -2
0 -2 0 -2 0
0 0 -2 0 0
0 -2 0 -2 0
-2 0 0 0 -2


Output

18

Note

In the first test, we can apply this operation twice: first on the top left 2 × 2 sub-board, then on the bottom right 2 × 2 sub-board. Then all numbers will become positive.

<image>
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            DCielAndFlipboard solver = new DCielAndFlipboard();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class DCielAndFlipboard {
        public int eval(int sign, int x) {
            return sign == 1 ? -x : x;
        }

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.ri();
            int m = (n + 1) / 2;
            int[][] mat = new int[n][n];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    mat[i][j] = in.ri();
                }
            }
            int[][] optimal = new int[2][m];
            int[] middle = new int[n];
            int best = Integer.MIN_VALUE;
            for (int i = 0; i < 1 << m; i++) {
                for (int j = 0; j < n; j++) {
                    if (j < m) {
                        middle[j] = Bits.get(i, j);
                    } else {
                        middle[j] = middle[j - m] ^ middle[m - 1];
                    }
                }
                int sum = 0;
                for (int j = 0; j < n; j++) {
                    int contrib = eval(middle[j], mat[j][m - 1]);
                    sum += contrib;
                }
                SequenceUtils.deepFill(optimal, 0);
                for (int r = 0; r < m - 1; r++) {
                    for (int c = 0; c < m - 1; c++) {
                        for (int mirror = 0; mirror < 2; mirror++) {
                            int localContrib = eval(0, mat[r][c]) +
                                    eval(0 ^ middle[r], mat[r][c + m]) +
                                    eval(0 ^ mirror, mat[r + m][c]) +
                                    eval(0 ^ mirror ^ middle[r + m], mat[r + m][c + m]);
                            localContrib = Math.abs(localContrib);
                            optimal[mirror][c] += localContrib;
                        }
                    }
                }
                for (int c = 0; c < m - 1; c++) {
                    for (int mirror = 0; mirror < 2; mirror++) {
                        int localContrib = eval(mirror, mat[m - 1][c]) +
                                eval(mirror ^ middle[m - 1], mat[m - 1][c + m]);
                        optimal[mirror][c] += localContrib;
                    }
                }
                for (int c = 0; c < m - 1; c++) {
                    sum += Math.max(optimal[0][c], optimal[1][c]);
                }
                best = Math.max(best, sum);
            }

            out.println(best);
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private static final int THRESHOLD = 32 << 10;
        private final Writer os;
        private StringBuilder cache = new StringBuilder(THRESHOLD * 2);

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        private void afterWrite() {
            if (cache.length() < THRESHOLD) {
                return;
            }
            flush();
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println() {
            return append('\n');
        }

        public FastOutput flush() {
            try {
//            boolean success = false;
//            if (stringBuilderValueField != null) {
//                try {
//                    char[] value = (char[]) stringBuilderValueField.get(cache);
//                    os.write(value, 0, cache.length());
//                    success = true;
//                } catch (Exception e) {
//                }
//            }
//            if (!success) {
                os.append(cache);
//            }
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class SequenceUtils {
        public static void deepFill(Object array, int val) {
            if (!array.getClass().isArray()) {
                throw new IllegalArgumentException();
            }
            if (array instanceof int[]) {
                int[] intArray = (int[]) array;
                Arrays.fill(intArray, val);
            } else {
                Object[] objArray = (Object[]) array;
                for (Object obj : objArray) {
                    deepFill(obj, val);
                }
            }
        }

    }

    static class Bits {
        private Bits() {
        }

        public static int get(int x, int i) {
            return (x >>> i) & 1;
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int ri() {
            return readInt();
        }

        public int readInt() {
            boolean rev = false;

            skipBlank();
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = read();
            }

            int val = 0;
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }

            return rev ? val : -val;
        }

    }
}

