calc :: Integer -> Integer -> Integer
calc n l
    | 0 < l = (n - 1) * (2 * l + n) `div` 2
    | l < (1 - n) = (n - 1) * (2 * l + n - 2) `div` 2
    | otherwise = n * (2 * l + n - 1) `div` 2

main = do
  n:l:_ <- map (read :: String -> Integer) . words <$> getLine
  putStrLn . show $ calc n l
