n, m = [int(x) for x in input().split()] if n > m: n,m = m,n cuts = 0 cuts += n-1 cuts += n*(m-1) print(cuts)