# ABC083B - Some Sums

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

total = 0

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

    if a <= sum(list(map(int, list(str(i))))) <= b:

        total += i

print(total)
# ABC083B - Some Sums

def main():

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

    ans = 0

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

        if a <= sum(map(int, list(str(i)))) <= b:

            ans += i

    print(ans)





if __name__ == "__main__":

    main()
# ABC083B - Some Sums
n, a, b = list(map(int, input().rstrip().split()))
total = 0
for i in range(1, n + 1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        total += i
print(total)

# ABC083B - Some Sums
def main():
    n, a, b = list(map(int, input().rstrip().split()))
    ans = 0
    for i in range(1, n + 1):
        if a <= sum(map(int, list(str(i)))) <= b:
            ans += i
    print(ans)


if __name__ == "__main__":
    main()

-n, a, b = list(map(int, input().rstrip().split())) -total = 0 -for i in range(1, n + 1): -    if a <= sum(list(map(int, list(str(i))))) <= b: -        total += i -print(total) +def main(): +    n, a, b = list(map(int, input().rstrip().split())) +    ans = 0 +    for i in range(1, n + 1): +        if a <= sum(map(int, list(str(i)))) <= b: +            ans += i +    print(ans) + + +if __name__ == "__main__": +    main()