N, M = list(map(int, input().split()))



if N == 2 or M == 2:

    print((0))



else:

    print((abs((N - 2) * (M - 2))))
N, M = list(map(int, input().split()))

print((abs((N - 2) * (M - 2))))
N, M = list(map(int, input().split()))
if N == 2 or M == 2:
    print((0))
else:
    print((abs((N - 2) * (M - 2))))

N, M = list(map(int, input().split()))
print((abs((N - 2) * (M - 2))))

-if N == 2 or M == 2: -    print((0)) -else: -    print((abs((N - 2) * (M - 2)))) +print((abs((N - 2) * (M - 2))))