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

l = []

ans = 0



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

    count = 0

    n_list = n

    while True:

        count += n%10

        n = n//10

        if n==0:

            break



    if A<= count <=B:

        l.append(n_list)



for i in l:

    ans += i



print(ans) 
# 関数を使った場合

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

ans = 0



def FindSumOfDigits(x):

    count = 0

    while x>0:

        count += x%10

        x = x//10

    

    return count

    



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

    count = FindSumOfDigits(n)

    if A<= count <=B:

        ans += n



print(ans) 
N, A, B = list(map(int, input().split()))
l = []
ans = 0
for n in range(1, N + 1):
    count = 0
    n_list = n
    while True:
        count += n % 10
        n = n // 10
        if n == 0:
            break
    if A <= count <= B:
        l.append(n_list)
for i in l:
    ans += i
print(ans)

# 関数を使った場合
N, A, B = list(map(int, input().split()))
ans = 0


def FindSumOfDigits(x):
    count = 0
    while x > 0:
        count += x % 10
        x = x // 10
    return count


for n in range(1, N + 1):
    count = FindSumOfDigits(n)
    if A <= count <= B:
        ans += n
print(ans)

+# 関数を使った場合 -l = [] + + +def FindSumOfDigits(x): +    count = 0 +    while x > 0: +        count += x % 10 +        x = x // 10 +    return count + + -    count = 0 -    n_list = n -    while True: -        count += n % 10 -        n = n // 10 -        if n == 0: -            break +    count = FindSumOfDigits(n) -        l.append(n_list) -for i in l: -    ans += i +        ans += n