n, m = [int(x) for x in input().split()]

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

print((abs(n - 2) * abs(m - 2)))
n, m = [int(x) for x in input().split()]
print((abs(n - 2) * abs(m - 2)))

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

-n, m = [int(x) for x in input().split()] +n, m = list(map(int, input().split()))