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

ans = 0

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

    ns = str(i)

    t = 0

    for j in ns:

        t+= int(j)

    if t >= a and t <= b:

        ans+=i

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

ans = 0

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

    ti = 0

    tmp = i

    while tmp!=0:

        ti += tmp%10

        tmp = tmp//10

    if ti>=a and ti<=b:

        ans+=i

print(ans)
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    ns = str(i)
    t = 0
    for j in ns:
        t += int(j)
    if t >= a and t <= b:
        ans += i
print(ans)

n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    ti = 0
    tmp = i
    while tmp != 0:
        ti += tmp % 10
        tmp = tmp // 10
    if ti >= a and ti <= b:
        ans += i
print(ans)

-    ns = str(i) -    t = 0 -    for j in ns: -        t += int(j) -    if t >= a and t <= b: +    ti = 0 +    tmp = i +    while tmp != 0: +        ti += tmp % 10 +        tmp = tmp // 10 +    if ti >= a and ti <= b: