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

Sum_0 = 0



for i in range(N+1):

    i = str(i)

    Sum_1 = 0

    for t in i:

        Sum_1 += int(t)

    if a <= Sum_1 <=b:

        Sum_0+=int(i)

print (Sum_0)
N,a,b = list(map(int,input().split()))

Sum_0 = 0



for i in range(1,N+1):

    Sum_1 = 0

    t = i

    while t != 0:

        Sum_1+=t%10

        t = t//10

        

    if a <= Sum_1 <= b:

        Sum_0+=i

print(Sum_0)
N, a, b = list(map(int, input().split()))
Sum_0 = 0
for i in range(N + 1):
    i = str(i)
    Sum_1 = 0
    for t in i:
        Sum_1 += int(t)
    if a <= Sum_1 <= b:
        Sum_0 += int(i)
print(Sum_0)

N, a, b = list(map(int, input().split()))
Sum_0 = 0
for i in range(1, N + 1):
    Sum_1 = 0
    t = i
    while t != 0:
        Sum_1 += t % 10
        t = t // 10
    if a <= Sum_1 <= b:
        Sum_0 += i
print(Sum_0)

-for i in range(N + 1): -    i = str(i) +for i in range(1, N + 1): -    for t in i: -        Sum_1 += int(t) +    t = i +    while t != 0: +        Sum_1 += t % 10 +        t = t // 10 -        Sum_0 += int(i) +        Sum_0 += i