read n x
b=0
if [ $n -eq $(( x * 2 )) ]
then
	echo $(( x * 3 ))
	exit
elif [ $n -gt $(( x * 2 )) ]
then
	a=$(( n - x ))
	for i in `seq $x`
	do
		b=$(( i * a + b ))
	done
elif [ $n -lt $(( x * 2 )) ]
then
	x=$(( n - x ))
	a=$(( n - x ))
	for i in `seq $x`
	do
		b=$(( i * a + b ))
	done
fi
echo $(( a + b ))
