a,b = [int(c) for c in input().split()] cuts = (b-1) + b*(a-1) print(cuts)