def main():

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

    if (n == 1 and a != b) or (b < a):

        print((0))

        exit()

    mini = a * (n - 1) + b

    maxi = a + b * (n - 1)

    print((maxi - mini + 1))





if __name__ == '__main__':

    main()

def main():

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

    print((0 if (n == 1 and a != b) or a > b else (b - a) * (n - 1) + a - b + 1))

    

if __name__ == '__main__':

    main()

def main():
    n, a, b = list(map(int, input().split()))
    if (n == 1 and a != b) or (b < a):
        print((0))
        exit()
    mini = a * (n - 1) + b
    maxi = a + b * (n - 1)
    print((maxi - mini + 1))


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

-    if (n == 1 and a != b) or (b < a): -        print((0)) -        exit() -    mini = a * (n - 1) + b -    maxi = a + b * (n - 1) -    print((maxi - mini + 1)) +    print((0 if (n == 1 and a != b) or a > b else (b - a) * (n - 1) + a - b + 1))