n, l = list(map(int,input().split()))



pies = [l+i-1 for i in range(1,n+1)]

pie_plan = sum(pies)

pie_real = 0

diff_plan_real = float("inf")

for i in range(1,n+1):

    pie_provisonal = sum([l+j-1 for j in range(1,n+1) if j != i])

    if abs(pie_plan - pie_provisonal) < diff_plan_real:

        diff_plan_real = abs(pie_plan - pie_provisonal)

        pie_real = pie_provisonal

    

print(pie_real)
def main():

    N, L = (int(i) for i in input().split())

    s = 0

    li = []

    for i in range(1, N+1):

        s += L + i - 1

        li.append((abs(L + i - 1), i))

    li.sort()



    print((s - (L + li[0][1] - 1)))





if __name__ == '__main__':

    main()

n, l = list(map(int, input().split()))
pies = [l + i - 1 for i in range(1, n + 1)]
pie_plan = sum(pies)
pie_real = 0
diff_plan_real = float("inf")
for i in range(1, n + 1):
    pie_provisonal = sum([l + j - 1 for j in range(1, n + 1) if j != i])
    if abs(pie_plan - pie_provisonal) < diff_plan_real:
        diff_plan_real = abs(pie_plan - pie_provisonal)
        pie_real = pie_provisonal
print(pie_real)

def main():
    N, L = (int(i) for i in input().split())
    s = 0
    li = []
    for i in range(1, N + 1):
        s += L + i - 1
        li.append((abs(L + i - 1), i))
    li.sort()
    print((s - (L + li[0][1] - 1)))


if __name__ == "__main__":
    main()

-n, l = list(map(int, input().split())) -pies = [l + i - 1 for i in range(1, n + 1)] -pie_plan = sum(pies) -pie_real = 0 -diff_plan_real = float("inf") -for i in range(1, n + 1): -    pie_provisonal = sum([l + j - 1 for j in range(1, n + 1) if j != i]) -    if abs(pie_plan - pie_provisonal) < diff_plan_real: -        diff_plan_real = abs(pie_plan - pie_provisonal) -        pie_real = pie_provisonal -print(pie_real) +def main(): +    N, L = (int(i) for i in input().split()) +    s = 0 +    li = [] +    for i in range(1, N + 1): +        s += L + i - 1 +        li.append((abs(L + i - 1), i)) +    li.sort() +    print((s - (L + li[0][1] - 1))) + + +if __name__ == "__main__": +    main()