m,n = input().strip().split() m,n = int(m), int(n) result = n-1 + (m-1)*n if n <1 or m <1 : result =0 print(result)