sum (m+1-i)*(n+1-i) for i from 1 to m