N, L = list(map(int, input().split()))

total = 0

for i in range(N):

    total += (L + i)



if L > 0: print((total - L))

elif L + N - 1 < 0: print((total - (L + N - 1)))

else: print(total)

import sys



def solve():

    input = sys.stdin.readline

    N, L = list(map(int, input().split()))

    sumT, minT = 0, 100000000000

    pm = 0

    for i in range(N):

        sumT += L + i

        if abs(L + i) < minT:

            minT = abs(L + i)

            if L + i < 0: pm = 1

    print((sumT - minT * (-1) ** pm))

        



    return 0



if __name__ == "__main__":

    solve()
N, L = list(map(int, input().split()))
total = 0
for i in range(N):
    total += L + i
if L > 0:
    print((total - L))
elif L + N - 1 < 0:
    print((total - (L + N - 1)))
else:
    print(total)

import sys


def solve():
    input = sys.stdin.readline
    N, L = list(map(int, input().split()))
    sumT, minT = 0, 100000000000
    pm = 0
    for i in range(N):
        sumT += L + i
        if abs(L + i) < minT:
            minT = abs(L + i)
            if L + i < 0:
                pm = 1
    print((sumT - minT * (-1) ** pm))
    return 0


if __name__ == "__main__":
    solve()

-N, L = list(map(int, input().split())) -total = 0 -for i in range(N): -    total += L + i -if L > 0: -    print((total - L)) -elif L + N - 1 < 0: -    print((total - (L + N - 1))) -else: -    print(total) +import sys + + +def solve(): +    input = sys.stdin.readline +    N, L = list(map(int, input().split())) +    sumT, minT = 0, 100000000000 +    pm = 0 +    for i in range(N): +        sumT += L + i +        if abs(L + i) < minT: +            minT = abs(L + i) +            if L + i < 0: +                pm = 1 +    print((sumT - minT * (-1) ** pm)) +    return 0 + + +if __name__ == "__main__": +    solve()