import math



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



sum_all = 0

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

    sum_n = 0

    m = i

    while(m > 0):

        sum_n += math.floor(m % 10)

        m /= 10

    if a <= sum_n <= b:

        sum_all += i



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

sum_all = 0

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

    m = str(i)

    sum_m = 0

    for j in range(len(m)):

        sum_m += int(m[j])

    if a <= sum_m <= b:

        sum_all += i

print(sum_all)
import math

n, a, b = list(map(int, input().split()))
sum_all = 0
for i in range(1, n + 1):
    sum_n = 0
    m = i
    while m > 0:
        sum_n += math.floor(m % 10)
        m /= 10
    if a <= sum_n <= b:
        sum_all += i
print(sum_all)

n, a, b = list(map(int, input().split()))
sum_all = 0
for i in range(1, n + 1):
    m = str(i)
    sum_m = 0
    for j in range(len(m)):
        sum_m += int(m[j])
    if a <= sum_m <= b:
        sum_all += i
print(sum_all)

-import math - -    sum_n = 0 -    m = i -    while m > 0: -        sum_n += math.floor(m % 10) -        m /= 10 -    if a <= sum_n <= b: +    m = str(i) +    sum_m = 0 +    for j in range(len(m)): +        sum_m += int(m[j]) +    if a <= sum_m <= b: