'use strict'

const main = input => {
	const args = input.split('\n').map(t => t.split(' '))
	const n = parseInt(args[0][0], 10)
	const l = parseInt(args[0][1], 10)
	let min = Infinity
	let res = null

	let all = 0

	for (let i = 0; i < n; i++) {
		all += l + i
	}

	for (let i = 0; i < n; i++) {
		let eat = 0

		for (let j = 0; j < n; j++) {
			if (i === j) continue
			eat += l + j
		}

		const t1 = Math.abs(eat - all)

		if (t1 < min) {
			min = t1
			res = eat
		}
	}

	console.log(res)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
