eval('print(('+input().replace(' ','-1)*(')+'-1))')
a,b=list(map(int,input().split()));print((~-a*~-b))
eval("print((" + input().replace(" ", "-1)*(") + "-1))")

a, b = list(map(int, input().split()))
print((~-a * ~-b))

-eval("print((" + input().replace(" ", "-1)*(") + "-1))") +a, b = list(map(int, input().split())) +print((~-a * ~-b))