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



if A > B:

  print((0))

elif A == B:

  print((1))

else:

  if N == 1:

    if A != B:

      print((0))

    else:

      print((1))

  else:

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

ans = max(0, b * (n - 1) + a - (b + a * (n - 1)) + 1)

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

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

-N, A, B = list(map(int, input().split())) -if A > B: -    print((0)) -elif A == B: -    print((1)) -else: -    if N == 1: -        if A != B: -            print((0)) -        else: -            print((1)) -    else: -        print(((N - 2) * (B - A) + 1)) +n, a, b = list(map(int, input().split())) +ans = max(0, b * (n - 1) + a - (b + a * (n - 1)) + 1) +print(ans)