paper = [int(x) for x in input().strip().split(' ')] print(paper[0] - 1 + paper[0] * (paper[1]-1))