import Control.Monad
 
import Data.Ord
import Data.List
import Data.Function
import Data.Maybe
 
import qualified Data.ByteString.Char8 as BS
 
import Debug.Trace
 
tuplify2 :: [a] -> (a, a)
tuplify2 (x:y:_) = (x, y)
tuplify2 _ = undefined
 
readInt = read :: String -> Integer
readIntTuple = tuplify2 . map readInt . words
readIntList = map readInt . words
 
getInt = readInt <$> getLine
getIntList = readIntList <$> getLine
getIntMatrix = map readIntList . lines <$> getContents
getIntTuple = readIntTuple <$> getLine
getIntTuples = map readIntTuple . lines <$> getContents

main = do
  [n,l] <- getIntList
  print $ f n l

-- リンゴ1の味はl
-- リンゴnの味はl+n+1
-- 総計はn*l+(n-1)n/2
-- 絶対値最小のリンゴを引けば良い、それは両端のいずれか又は0
f n l
  | taste1 > 0 && tasteN > 0 = tasteSum-taste1
  | taste1 < 0 && tasteN < 0 = tasteSum-tasteN
  | otherwise = tasteSum
  where
    taste1 = l
    tasteN = l+n-1
    tasteSum = n*l + (n-1)*n `div` 2
