from itertools import combinations

n = int(input())
grid = [[int(x) for x in input().split()] for _ in range(n)]

best_score = -10**20
for tup in combinations(range(n), n//2):
    team = set(tup)
    score = 0
    for i in range(n):
        for j in range(i+1, n):
            if i in team and j in team:
                score += grid[i][j]
            elif i not in team and j not in team:
                score -= grid[i][j]
    if score > best_score:
        best_score = score
print(best_score)
