#get input inputs = input() list = inputs.split() n = int(list[0]) m = int(list[1]) firstCut = n -1 if (m > 1): secCut = m - 1 else: secCut = m #Find max cuts firstCut if(m > 1): res = n*m -1 else: res = firstCut print(res)