def main():
#fin = open("flip.in","r")
#nm = [int(i) for i in fin.readline().split()]
nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]
matrix = [list(map(int, input().split())) for _ in range(n)]
#print(matrix)
sum_max = 0
def solve_flip(stack):
#declare the variable as nonlocal to modify the outer variable
nonlocal sum_max
#declare a variable that holds local stotal
stotal = 0
#make a copy of the matrix
matrix2 = [row[:] for row in matrix]
for line in stack:
for j in range(m):
matrix2[line][j] *= -1
for j in range(m):
s = 0
for i in range(n):
s += matrix2[i][j]
if s<0:
s *= -1
stotal += s
if sum_max < stotal:
sum_max = stotal
size = 2**n
mask = 1
for i in range(1,size):
#empty stack
stack = []
for j in range(n):
if (mask<<j)&i:
#print(j, end = " ")
stack.append(j)
solve_flip(stack)
#fout = open("flip.out","w")
print(sum_max)
#fout.write(str(sum_max))
main()
ZGVmIG1haW4oKToKICAgICNmaW4gPSBvcGVuKCJmbGlwLmluIiwiciIpCiAgICAjbm0gPSBbaW50KGkpIGZvciBpIGluIGZpbi5yZWFkbGluZSgpLnNwbGl0KCldCiAgICBubSA9IFtpbnQoaSkgZm9yIGkgaW4gaW5wdXQoKS5zcGxpdCgpXQogICAgbiA9IG5tWzBdCiAgICBtID0gbm1bMV0KICAgIG1hdHJpeCA9IFtsaXN0KG1hcChpbnQsIGlucHV0KCkuc3BsaXQoKSkpIGZvciBfIGluIHJhbmdlKG4pXQogICAgI3ByaW50KG1hdHJpeCkKICAgIHN1bV9tYXggPSAwCgogICAgZGVmIHNvbHZlX2ZsaXAoc3RhY2spOgoKICAgICAgICAjZGVjbGFyZSB0aGUgdmFyaWFibGUgYXMgbm9ubG9jYWwgdG8gbW9kaWZ5IHRoZSBvdXRlciB2YXJpYWJsZQogICAgICAgIG5vbmxvY2FsIHN1bV9tYXgKICAgICAgICAjZGVjbGFyZSBhIHZhcmlhYmxlIHRoYXQgaG9sZHMgbG9jYWwgc3RvdGFsCiAgICAgICAgc3RvdGFsID0gMAogICAgICAgICNtYWtlIGEgY29weSBvZiB0aGUgbWF0cml4CiAgICAgICAgbWF0cml4MiA9IFtyb3dbOl0gZm9yIHJvdyBpbiBtYXRyaXhdCgogICAgICAgIGZvciBsaW5lIGluIHN0YWNrOgogICAgICAgICAgICBmb3IgaiBpbiByYW5nZShtKToKICAgICAgICAgICAgICAgIG1hdHJpeDJbbGluZV1bal0gKj0gLTEKCiAgICAgICAgZm9yIGogaW4gcmFuZ2UobSk6CiAgICAgICAgICAgIHMgPSAwCiAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKG4pOgogICAgICAgICAgICAgICAgcyArPSBtYXRyaXgyW2ldW2pdCiAgICAgICAgICAgIGlmIHM8MDoKICAgICAgICAgICAgICAgcyAqPSAtMQogICAgICAgICAgICBzdG90YWwgKz0gcwoKICAgICAgICBpZiBzdW1fbWF4IDwgc3RvdGFsOgogICAgICAgICAgICBzdW1fbWF4ID0gc3RvdGFsCgogICAgc2l6ZSA9IDIqKm4KICAgIG1hc2sgPSAxCiAgICBmb3IgaSBpbiByYW5nZSgxLHNpemUpOgogICAgICAgICNlbXB0eSBzdGFjawogICAgICAgIHN0YWNrID0gW10KICAgICAgICBmb3IgaiBpbiByYW5nZShuKToKICAgICAgICAgICAgaWYgKG1hc2s8PGopJmk6CiAgICAgICAgICAgICAgICAjcHJpbnQoaiwgZW5kID0gIiAiKQogICAgICAgICAgICAgICAgc3RhY2suYXBwZW5kKGopCiAgICAgICAgc29sdmVfZmxpcChzdGFjaykKICAgICNmb3V0ID0gb3BlbigiZmxpcC5vdXQiLCJ3IikKICAgIHByaW50KHN1bV9tYXgpCiAgICAjZm91dC53cml0ZShzdHIoc3VtX21heCkpCm1haW4oKQ==