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

ans = 0

i = 1

while i <= n:

    x = 0

    li = list(str(i))

    for p in li:

        x += int(p)

    if a <= x <= b:

        ans += i

        i += 1

    else:

        i += 1

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

ans = 0

i = 1

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

    x = 0

    num = str(i)

    for p in num:

        x += int(p)

    if a <= x <= b:

        ans += i

        i += 1

print(ans)
n, a, b = list(map(int, input().split()))
ans = 0
i = 1
while i <= n:
    x = 0
    li = list(str(i))
    for p in li:
        x += int(p)
    if a <= x <= b:
        ans += i
        i += 1
    else:
        i += 1
print(ans)

n, a, b = list(map(int, input().split()))
ans = 0
i = 1
for i in range(1, n + 1):
    x = 0
    num = str(i)
    for p in num:
        x += int(p)
    if a <= x <= b:
        ans += i
        i += 1
print(ans)

-while i <= n: +for i in range(1, n + 1): -    li = list(str(i)) -    for p in li: +    num = str(i) +    for p in num: -    else: -        i += 1