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

ans=(N-1)*(M-1)



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

print(((N-1)*(M-1)))
N, M = list(map(int, input().split()))
ans = (N - 1) * (M - 1)
print(ans)

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

-ans = (N - 1) * (M - 1) -print(ans) +print(((N - 1) * (M - 1)))