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

ans = 0



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

    r = (i - i % 10000)

    s = (i - i % 1000)

    t = (i - i % 100)

    u = (i - i % 10)

    v = i % 10



    u = (u - t) / 10    

    t = (t - s) / 100

    s = (s - r) / 1000

    r = r / 10000

    

    if A <= s+t+u+v+r and r+s+t+u+v <= B:

        ans += i

    

print(ans)

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

ans = 0



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

    j = i

    tmp = 0

    while j != 0:

        tmp += j % 10

        j = j // 10

        

    if A <= tmp and tmp <= B:

        ans += i

print(ans)
N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    r = i - i % 10000
    s = i - i % 1000
    t = i - i % 100
    u = i - i % 10
    v = i % 10
    u = (u - t) / 10
    t = (t - s) / 100
    s = (s - r) / 1000
    r = r / 10000
    if A <= s + t + u + v + r and r + s + t + u + v <= B:
        ans += i
print(ans)

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    j = i
    tmp = 0
    while j != 0:
        tmp += j % 10
        j = j // 10
    if A <= tmp and tmp <= B:
        ans += i
print(ans)

-    r = i - i % 10000 -    s = i - i % 1000 -    t = i - i % 100 -    u = i - i % 10 -    v = i % 10 -    u = (u - t) / 10 -    t = (t - s) / 100 -    s = (s - r) / 1000 -    r = r / 10000 -    if A <= s + t + u + v + r and r + s + t + u + v <= B: +    j = i +    tmp = 0 +    while j != 0: +        tmp += j % 10 +        j = j // 10 +    if A <= tmp and tmp <= B: