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