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)))

n, m = list(map(int, input().split()))
ans = (n - 1) * (m - 1)
print(ans)

-print(((n - 1) * (m - 1))) +ans = (n - 1) * (m - 1) +print(ans)