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

ans = 0

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

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

    ans += i

print(ans)
def digit_sum(x):

    res = 0

    while x != 0:

        res += x%10

        x //= 10

    return res

    

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

ans = 0

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

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

        ans += i

print(ans)

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

def digit_sum(x):
    res = 0
    while x != 0:
        res += x % 10
        x //= 10
    return res


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

-N, A, B = list(map(int, input().split())) +def digit_sum(x): +    res = 0 +    while x != 0: +        res += x % 10 +        x //= 10 +    return res + + +[N, A, B] = list(map(int, input().split())) -    if A <= sum([int(c) for c in str(i)]) <= B: +    if A <= digit_sum(i) <= B: