N, A, B = list(map(int, input().split()))



sum = 0

for n in range(N + 1):

    wa = 0

    sn = str(n)

    size = len(sn)

    for s in range(size):

        wa += int(sn[s])

    if A <= wa and B >= wa:

        sum += n

print(sum)
def sumOfDigits(n):

    sum = 0

    while(n > 0):

        sum += n % 10

        n //= 10

    return sum



N, A, B = list(map(int, input().split()))



sum = 0

for n in range(N + 1):

    wa = sumOfDigits(n)

    if A <= wa and B >= wa:

        sum += n

print(sum)
N, A, B = list(map(int, input().split()))
sum = 0
for n in range(N + 1):
    wa = 0
    sn = str(n)
    size = len(sn)
    for s in range(size):
        wa += int(sn[s])
    if A <= wa and B >= wa:
        sum += n
print(sum)

def sumOfDigits(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n //= 10
    return sum


N, A, B = list(map(int, input().split()))
sum = 0
for n in range(N + 1):
    wa = sumOfDigits(n)
    if A <= wa and B >= wa:
        sum += n
print(sum)

+def sumOfDigits(n): +    sum = 0 +    while n > 0: +        sum += n % 10 +        n //= 10 +    return sum + + -    wa = 0 -    sn = str(n) -    size = len(sn) -    for s in range(size): -        wa += int(sn[s]) +    wa = sumOfDigits(n)