{-# LANGUAGE BangPatterns #-}
import Control.Arrow
import Control.Monad.Fix
import Data.Char
import Data.Int
import Data.Foldable
import Data.List
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Debug.Trace

solve :: Int -> Int -> Int
solve !n !l = expected - mostCloseTo0
 where
  apples = map (\i -> l + i - 1) [1 .. n]
  mostCloseTo0 =
    (\xs -> if null xs then maximum (filter (< 0) apples) else minimum xs)
      $ filter (>= 0) apples
  expected = sum apples

main = do
  let readInt :: Integral a => B.ByteString -> Maybe (a, B.ByteString)
      readInt = fmap (first fromIntegral . second B.tail) . B.readInt

  (n, l) <-
    (\vec -> (vec VU.! 0, vec VU.! 1)) . VU.unfoldrN 2 readInt <$> B.getLine
  print $ solve n l
