import sys
import itertools
n, a, b = map(int, input().split())
if n == 1:
    if a != b:
        print(0)
    else:
        print(1)
    sys.exit()
if n == 2:
    if a > b:
        print(0)
    else:
        print(1)
    sys.exit()

if a > b:
    print(0)
    sys.exit()

if a > 1000000007 or b > 1000000007:
    a = a%1000000007
    b = b%1000000007

total = set([sum(i)%1000000007 for i in itertools.combinations_with_replacement(range(a,b+1), n-2)])
print(len(total))