N,A,B = list(map(int, input().split()))



if N == 1 and A != B:

    print((0))

    exit()

if A > B:

    print((0))

    exit()

if N == 2:

    print((1))

    exit()



m = N - 2

print((B*m - A*m + 1))
N,A,B=list(map(int, input().split()))



if A>B:

    print((0))

    exit()

elif N==1 and A!=B:

    print((0))

    exit()



mn=A*(N-1) + B

mx=A + B*(N-1)

print((mx-mn+1))

N, A, B = list(map(int, input().split()))
if N == 1 and A != B:
    print((0))
    exit()
if A > B:
    print((0))
    exit()
if N == 2:
    print((1))
    exit()
m = N - 2
print((B * m - A * m + 1))

N, A, B = list(map(int, input().split()))
if A > B:
    print((0))
    exit()
elif N == 1 and A != B:
    print((0))
    exit()
mn = A * (N - 1) + B
mx = A + B * (N - 1)
print((mx - mn + 1))

-if N == 1 and A != B: -    print((0)) -    exit() -if N == 2: -    print((1)) +elif N == 1 and A != B: +    print((0)) -m = N - 2 -print((B * m - A * m + 1)) +mn = A * (N - 1) + B +mx = A + B * (N - 1) +print((mx - mn + 1))