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

print((~-a*~-b))
print((eval("~-" + "*~-".join(input().split()))))

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

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