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

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

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

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

-print((abs(N - 2) * abs(M - 2))) +print((abs((N - 2) * (M - 2))))