N, A, B = map(int, input().split())
print(0 if N == 1 and A != B else max(0, max(0, N - 2) * (B - A) + 1))

7ab27e2fe5c52d985a085a9ca2f457c8c910e916
<mask token>

<mask token>
print(0 if N == 1 and A != B else max(0, max(0, N - 2) * (B - A) + 1))

N, A, B = map(int, input().split())
print(0 if N == 1 and A != B else max(0, max(0, N - 2) * (B - A) + 1))
