solver :: Int -> Int -> Int
solver n l =
  let tot = div (n * (2 * l + n - 1)) 2
   in if l > 0
        then tot - l
        else if (l + n - 1) < 0
               then tot - (l + n - 1)
               else tot

main :: IO ()
main = do
  n:l:[] <- map read . words <$> getLine
  print $ solver n l
