local n = io.read("*n")
local a = io.read("*n")
local b = io.read("*n")
local function add(n,a,b)
	if b < a then
		print(0)
		return
	end
	if n == 1 then
		if a ~= b then
			print(0)
			return
		else
			print(1)
			return
		end
	elseif n == 2 then
			print(1)
			return
	end
	local total = a + b
	local min = total + (n - 2) * a
	local max = total + (n-2)*b
	print( max - min + 1)
end

add(n,a,b)