V = input().split()
N = int(V[0])
C = int(V[1])
if N >= C:
    Custo = (C + 1) * C / 2 + N - C
else:
    Custo = (C + C - N + 1) * (C - (C - N)) / 2
print(int(Custo))

fa43ae1c2c2585f55fce923d024bdd5ccb9eef90
<mask token>

<mask token>
if N >= C:
    Custo = (C + 1) * C / 2 + N - C
else:
    Custo = (C + C - N + 1) * (C - (C - N)) / 2
print(int(Custo))

V = input().split()
N = int(V[0])
C = int(V[1])
if N >= C:
    Custo = (C + 1) * C / 2 + N - C
else:
    Custo = (C + C - N + 1) * (C - (C - N)) / 2
print(int(Custo))
