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

res = 0

for i in range(N+1):

    if A <= sum([int(s) for s in str(i)]) <= B:

        res += i

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

def keta_sum(x):

    m = 0

    while x:

        m += x%10

        x //= 10

    return(m)

res = 0

for i in range(N+1):

    if A <= keta_sum(i) <= B:

        res += i

print(res)
N, A, B = list(map(int, input().split()))
res = 0
for i in range(N + 1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)

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


def keta_sum(x):
    m = 0
    while x:
        m += x % 10
        x //= 10
    return m


res = 0
for i in range(N + 1):
    if A <= keta_sum(i) <= B:
        res += i
print(res)

+ + +def keta_sum(x): +    m = 0 +    while x: +        m += x % 10 +        x //= 10 +    return m + + -    if A <= sum([int(s) for s in str(i)]) <= B: +    if A <= keta_sum(i) <= B: