def digitsum(n):

    res = 0

    for i in range(5):

        res += (n//10**i)%10

    return res

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

res=0

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

    if a<=digitsum(i)<=b:

        res += i

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



def digitsum(num):

    s = str(num)

    r = 0

    for c in s:

        r += int(c)

    return r



res = 0

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

    if a<=digitsum(i)<=b:

        res += i

print(res)

def digitsum(n):
    res = 0
    for i in range(5):
        res += (n // 10**i) % 10
    return res


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

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


def digitsum(num):
    s = str(num)
    r = 0
    for c in s:
        r += int(c)
    return r


res = 0
for i in range(1, n + 1):
    if a <= digitsum(i) <= b:
        res += i
print(res)

-def digitsum(n): -    res = 0 -    for i in range(5): -        res += (n // 10**i) % 10 -    return res +n, a, b = list(map(int, input().split())) -n, a, b = list(map(int, input().split())) +def digitsum(num): +    s = str(num) +    r = 0 +    for c in s: +        r += int(c) +    return r + +