n, k = [int(i) for i in input().split()] print(k * (2 * n - k + 1) // 2 + 1)