line = input().strip() list1 = [int(x) for x in line.split()] n = list1[0] m = list1[1] print((m-1)+m*(n-1))