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

if n == 2 or m == 2:

    print((0))

elif n == 1 and m == 1:

    print((1))

elif n == 1:

    print((m - 2))

elif m == 1:

    print((n - 2))

else:

    print(((n - 2) * (m - 2)))

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

n = abs(n - 2)

m = abs(m - 2)

print((n * m))

n, m = list(map(int, input().split()))
if n == 2 or m == 2:
    print((0))
elif n == 1 and m == 1:
    print((1))
elif n == 1:
    print((m - 2))
elif m == 1:
    print((n - 2))
else:
    print(((n - 2) * (m - 2)))

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

-if n == 2 or m == 2: -    print((0)) -elif n == 1 and m == 1: -    print((1)) -elif n == 1: -    print((m - 2)) -elif m == 1: -    print((n - 2)) -else: -    print(((n - 2) * (m - 2))) +n = abs(n - 2) +m = abs(m - 2) +print((n * m))