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

c =0

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

    d = sum(int(j) for j in list(str(i)))

    if a<=d and d<=b:

        c += i

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

ans = 0

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

    c = sum(list(map(int, str(i))))

    if a <= c <= b:

        ans += i

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

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

-c = 0 +ans = 0 -    d = sum(int(j) for j in list(str(i))) -    if a <= d and d <= b: -        c += i -print(c) +    c = sum(list(map(int, str(i)))) +    if a <= c <= b: +        ans += i +print(ans)