n,a,b = list(map(int,input().split()))

if n == 1 and a == b:

    print((1))

elif (n == 1 and a != b) or a > b:

    print((0))

else:

    print(((n-1)*b+a-((n-1)*a+b)+1))
n,a,b = list(map(int, input().split()))

if n == 1 and a==b:

    print((1))

elif n == 1 or a > b:

    print((0))

else:

    print(((n-2)*(b-a)+1))
n, a, b = list(map(int, input().split()))
if n == 1 and a == b:
    print((1))
elif (n == 1 and a != b) or a > b:
    print((0))
else:
    print(((n - 1) * b + a - ((n - 1) * a + b) + 1))

n, a, b = list(map(int, input().split()))
if n == 1 and a == b:
    print((1))
elif n == 1 or a > b:
    print((0))
else:
    print(((n - 2) * (b - a) + 1))

-elif (n == 1 and a != b) or a > b: +elif n == 1 or a > b: -    print(((n - 1) * b + a - ((n - 1) * a + b) + 1)) +    print(((n - 2) * (b - a) + 1))