n, m = list(map(int, input().split()))



if 2 <= n:

    n -= 2

if 2 <= m:

    m -= 2

    

print((n * m))
n, m = list(map(int, input().split()))



print((abs((n-2) * (m-2))))
n, m = list(map(int, input().split()))
if 2 <= n:
    n -= 2
if 2 <= m:
    m -= 2
print((n * m))

n, m = list(map(int, input().split()))
print((abs((n - 2) * (m - 2))))

-if 2 <= n: -    n -= 2 -if 2 <= m: -    m -= 2 -print((n * m)) +print((abs((n - 2) * (m - 2))))