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

ans = 0

for i in range(N+1):

    n = str(i)

    a = 0

    for j in range(len(n)):

        a += int(n[j:j+1])

    if a >= A and a <= B:

        ans += i

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

def digit_sum(n):

    sum = 0

    while (n>0):

        sum += n%10

        n = int(n/10)

    return(sum)



ans = 0

for i in range(N+1):

    a = digit_sum(i)

    if A <= a <= B:

        ans += i

#        print(i)

print(ans)
N, A, B = list(map(int, input().split()))
ans = 0
for i in range(N + 1):
    n = str(i)
    a = 0
    for j in range(len(n)):
        a += int(n[j : j + 1])
    if a >= A and a <= B:
        ans += i
print(ans)

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


def digit_sum(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = int(n / 10)
    return sum


ans = 0
for i in range(N + 1):
    a = digit_sum(i)
    if A <= a <= B:
        ans += i
#        print(i)
print(ans)

+ + +def digit_sum(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n = int(n / 10) +    return sum + + -    n = str(i) -    a = 0 -    for j in range(len(n)): -        a += int(n[j : j + 1]) -    if a >= A and a <= B: +    a = digit_sum(i) +    if A <= a <= B: +#        print(i)