A,B=list(map(int,input().split()))

print(((A-1) * (B-1)))
print((eval('('+input().replace(' ','-1)*(')+'-1)')))
A, B = list(map(int, input().split()))
print(((A - 1) * (B - 1)))

print((eval("(" + input().replace(" ", "-1)*(") + "-1)")))

-A, B = list(map(int, input().split())) -print(((A - 1) * (B - 1))) +print((eval("(" + input().replace(" ", "-1)*(") + "-1)")))