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

r=0

for i in range(n+1):

    if a<=sum([int(j) for j in str(i)])<=b:

        r+=i

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

s=0

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

    k=0

    m=i

    while m>0:

        k+=m%10

        m=m//10

    if a<=k<=b:

        s+=i

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

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

-r = 0 -for i in range(n + 1): -    if a <= sum([int(j) for j in str(i)]) <= b: -        r += i -print(r) +s = 0 +for i in range(1, n + 1): +    k = 0 +    m = i +    while m > 0: +        k += m % 10 +        m = m // 10 +    if a <= k <= b: +        s += i +print(s)