#!/usr/bin/env python3

# coding=utf-8



import sys



def digit_sum(n):

    s = str(n)

    array = list(map(int, list(s)))

    return sum(array)



n, a, b = sys.stdin.readline().split(" ")

n = int(n)

a = int(a)

b = int(b)

ans = 0

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

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

        ans += i

print(ans)
def solve(string):

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



    def check(i):

        return a <= sum([int(_i) for _i in str(i)]) <= b



    return str(sum([i for i in range(n + 1) if check(i)]))





if __name__ == '__main__':

    print((solve(eval(input()))))

#!/usr/bin/env python3
# coding=utf-8
import sys


def digit_sum(n):
    s = str(n)
    array = list(map(int, list(s)))
    return sum(array)


n, a, b = sys.stdin.readline().split(" ")
n = int(n)
a = int(a)
b = int(b)
ans = 0
for i in range(1, n + 1):
    if a <= digit_sum(i) <= b:
        ans += i
print(ans)

def solve(string):
    n, a, b = list(map(int, string.split()))

    def check(i):
        return a <= sum([int(_i) for _i in str(i)]) <= b

    return str(sum([i for i in range(n + 1) if check(i)]))


if __name__ == "__main__":
    print((solve(eval(input()))))

-#!/usr/bin/env python3 -# coding=utf-8 -import sys +def solve(string): +    n, a, b = list(map(int, string.split())) + +    def check(i): +        return a <= sum([int(_i) for _i in str(i)]) <= b + +    return str(sum([i for i in range(n + 1) if check(i)])) -def digit_sum(n): -    s = str(n) -    array = list(map(int, list(s))) -    return sum(array) - - -n, a, b = sys.stdin.readline().split(" ") -n = int(n) -a = int(a) -b = int(b) -ans = 0 -for i in range(1, n + 1): -    if a <= digit_sum(i) <= b: -        ans += i -print(ans) +if __name__ == "__main__": +    print((solve(eval(input()))))