import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (n : l : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  let
    d | l <= (- n) = l + n - 1
      | 0 < l = l
      | otherwise = 0
  print $ n * l + ((pred n * n) `div` 2) - d

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
