n = int(input()) F = [list(map(int,input().split())) for _ in range(n)] dp = [-1] * (1 << n) dp[0] = 0 for bit in range(1 << n): if bin(bit).count('1') & 1:continue i = 0 while bit & (1 << i):i += 1 b = bit | (1 <> j & 1:continue bj = b | (1 << j) if dp[bj] < dp[bit] + F[i][j]: dp[bj] = dp[bit] + F[i][j] print(dp[-1])