#!/bin/sh
read x y

if [ "${x::1}" != "-" -a ${y::1} != "-" ] || [ "${x::1}" = "-" -a ${y::1} = "-" ]
then
	if [ $x -lt $y ]
	then
		ans=$((y - x))
	elif [ $x -gt $y ]
	then
		ans=$((x - y + 2))
	fi

	if [ $y -eq 0 ]
	then
		ans=$((ans - 1))
	fi
	
	echo $ans
	exit
fi

if [ "${x::1}" != "-" -a ${y::1} = "-" ]
then
	if [ "${x}" = "${y/-/}" ]
	then
		echo 1
		exit
	fi
	
	yy="${y/-/}"
	
	if [ $x -gt $yy ]
	then
		ans=$((x - yy + 1))
	elif [ $x -lt $yy ]
	then
		ans=$((yy - x + 1))
	fi

	if [ $y -eq 0 ]
	then
		ans=$((ans - 1))
	fi

	echo $ans
	exit
fi

if [ "${y::1}" != "-" -a ${x::1} = "-" ]
then
	if [ "${y}" = "${x/-/}" ]
	then
		echo 1
		exit
	fi
	
	xx="${x/-/}"
	
	if [ $y -gt $xx ]
	then
		ans=$((y - xx + 1))
	elif [ $y -lt $xx ]
	then
		ans=$((xx - y + 1))
	fi

	if [ $y -eq 0 ]
	then
		ans=$((ans - 1))
	fi

	echo $ans
	exit
fi
