local n, a, b = io.read("n", "n", "n")

if n == 1 and a == b then
	print(1)
	os.exit()
elseif n == 1 then
	print(0)
	os.exit()
elseif a > b then
	print(0)
	os.exit()
end

print((n - 2) * (b - a) + 1)
