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

id = 0

ans = 0

for i in range(n):

    ans+=l+i

    if abs(l+id)>abs(l+i):

        id = i

print((ans-l-id))
def solve():

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

    mn = 10**10

    s = 0

    for i in range(n):

        s+=l+i

        if abs(mn)>abs(l+i):

            mn = l+i

    print((s-mn))

if __name__=='__main__':

    solve()
n, l = list(map(int, input().split()))
id = 0
ans = 0
for i in range(n):
    ans += l + i
    if abs(l + id) > abs(l + i):
        id = i
print((ans - l - id))

def solve():
    n, l = list(map(int, input().split()))
    mn = 10**10
    s = 0
    for i in range(n):
        s += l + i
        if abs(mn) > abs(l + i):
            mn = l + i
    print((s - mn))


if __name__ == "__main__":
    solve()

-n, l = list(map(int, input().split())) -id = 0 -ans = 0 -for i in range(n): -    ans += l + i -    if abs(l + id) > abs(l + i): -        id = i -print((ans - l - id)) +def solve(): +    n, l = list(map(int, input().split())) +    mn = 10**10 +    s = 0 +    for i in range(n): +        s += l + i +        if abs(mn) > abs(l + i): +            mn = l + i +    print((s - mn)) + + +if __name__ == "__main__": +    solve()