This can be done with the help of Mathematica. First, the function $f(m,n)$ finds the sum of the negative eigenvalues of the matrix under consideration. Second, we numerically find the maximum value of $f(x,y)$ over the integers greater than or equal to $4$ with relative error $10^{-3}$. The results are as follows.
f[m_, n_] := Total[Map[Min[0, #] &,
Eigenvalues[{{0, m - 1, 2, n - 1}, {1, m - 2, 1, n - 1}, {2, m - 1,
0, 2 n - 2}, {1, m - 1, 2, 2 n - 24}}] // N]]
NMaximize[{f[x, y], x >= 4 && y >= 4 && x \[Element] Integers && y \[Element] Integers},
{x, y}, Method -> {"DifferentialEvolution", "ScalingFactor" -> 1},
AccuracyGoal -> 3, PrecisionGoal -> 3, MaxIterations -> 1000]
$$\{-2.67282,\{x\to 62605783003825957106601552641839576616084246664423713800192,y\to 4\}\} $$$$\{-3.,\{x\to 12854143321479777526031848555457428151289960383333269504,y\to 1051298338250582241682620486779844006807195121763745792\}\} $$ Edit. A typo in the code for the matrix under consideration.