import sys

import numpy as np 



n, l = list(map(int, sys.stdin.readline().split()))



def main():

    f = l + np.arange(1, n+1) - 1

    s = f.sum()

    a = np.absolute(f)

    mi = np.amin(a)

    i = np.argwhere(a == mi)[0, 0]

    return s - f[i]



if __name__ == '__main__':

    ans = main()

    print(ans)
import sys



n, l = list(map(int, sys.stdin.readline().split()))



def main():

    s = (l - 1) * n + (1 + n) * n // 2

    res = []

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

        f = l + i - 1

        res.append((abs(f), s - f))

    

    res.sort()

    return res[0][1]



if __name__=='__main__':

    ans = main()

    print(ans)
import sys
import numpy as np

n, l = list(map(int, sys.stdin.readline().split()))


def main():
    f = l + np.arange(1, n + 1) - 1
    s = f.sum()
    a = np.absolute(f)
    mi = np.amin(a)
    i = np.argwhere(a == mi)[0, 0]
    return s - f[i]


if __name__ == "__main__":
    ans = main()
    print(ans)

import sys

n, l = list(map(int, sys.stdin.readline().split()))


def main():
    s = (l - 1) * n + (1 + n) * n // 2
    res = []
    for i in range(1, n + 1):
        f = l + i - 1
        res.append((abs(f), s - f))
    res.sort()
    return res[0][1]


if __name__ == "__main__":
    ans = main()
    print(ans)

-import numpy as np -    f = l + np.arange(1, n + 1) - 1 -    s = f.sum() -    a = np.absolute(f) -    mi = np.amin(a) -    i = np.argwhere(a == mi)[0, 0] -    return s - f[i] +    s = (l - 1) * n + (1 + n) * n // 2 +    res = [] +    for i in range(1, n + 1): +        f = l + i - 1 +        res.append((abs(f), s - f)) +    res.sort() +    return res[0][1]