import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, L = lr()

A = np.arange(1, N+1)

A += (L - 1)

answer = A.sum() - A[np.argmin(np.abs(A))]

print(answer)
import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, L = lr()

total = sum(range(L, L+N))

sub = min(list(range(L, L+N)), key=abs)

print((total-sub))

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, L = lr()
A = np.arange(1, N + 1)
A += L - 1
answer = A.sum() - A[np.argmin(np.abs(A))]
print(answer)

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, L = lr()
total = sum(range(L, L + N))
sub = min(list(range(L, L + N)), key=abs)
print((total - sub))

-import numpy as np -A = np.arange(1, N + 1) -A += L - 1 -answer = A.sum() - A[np.argmin(np.abs(A))] -print(answer) +total = sum(range(L, L + N)) +sub = min(list(range(L, L + N)), key=abs) +print((total - sub))