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()

def main():

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

    s = sum(L+i-1 for i in range(1, N+1))

    mi = 10**5

    ans = -1

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

        cur = L + i - 1

        eat = s - cur

        if abs(s - eat) < mi:

            mi = abs(s - eat)

            ans = eat

    print(ans)





if __name__ == '__main__':

    main()

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()

def main():
    N, L = (int(i) for i in input().split())
    s = sum(L + i - 1 for i in range(1, N + 1))
    mi = 10**5
    ans = -1
    for i in range(1, N + 1):
        cur = L + i - 1
        eat = s - cur
        if abs(s - eat) < mi:
            mi = abs(s - eat)
            ans = eat
    print(ans)


if __name__ == "__main__":
    main()

-    s = 0 -    li = [] +    s = sum(L + i - 1 for i in range(1, N + 1)) +    mi = 10**5 +    ans = -1 -        s += L + i - 1 -        li.append((abs(L + i - 1), i)) -    li.sort() -    print((s - (L + li[0][1] - 1))) +        cur = L + i - 1 +        eat = s - cur +        if abs(s - eat) < mi: +            mi = abs(s - eat) +            ans = eat +    print(ans)