# -*- coding: utf-8 -*-



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



answer = 0



for i in range(n+1):

    nc = list(str(i))

    nc = list(map(int,nc))

    ncsum = sum(nc)

    nc = list(map(str,nc))

    nc = int("".join(nc))

    if a <= ncsum and b >= ncsum:

        answer += nc



print(answer)

# -*- coding: utf-8 -*-



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



def digit_list(num):

    num = str(num)

    num = list(num)

    num = list(map(int,num))

    return num



cnt = 0



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

    temp = sum(digit_list(i))

    if a <= temp <= b:

        cnt += i



print(cnt)

# -*- coding: utf-8 -*-
n, a, b = list(map(int, input().split()))
answer = 0
for i in range(n + 1):
    nc = list(str(i))
    nc = list(map(int, nc))
    ncsum = sum(nc)
    nc = list(map(str, nc))
    nc = int("".join(nc))
    if a <= ncsum and b >= ncsum:
        answer += nc
print(answer)

# -*- coding: utf-8 -*-
n, a, b = list(map(int, input().split()))


def digit_list(num):
    num = str(num)
    num = list(num)
    num = list(map(int, num))
    return num


cnt = 0
for i in range(1, n + 1):
    temp = sum(digit_list(i))
    if a <= temp <= b:
        cnt += i
print(cnt)

-answer = 0 -for i in range(n + 1): -    nc = list(str(i)) -    nc = list(map(int, nc)) -    ncsum = sum(nc) -    nc = list(map(str, nc)) -    nc = int("".join(nc)) -    if a <= ncsum and b >= ncsum: -        answer += nc -print(answer) + + +def digit_list(num): +    num = str(num) +    num = list(num) +    num = list(map(int, num)) +    return num + + +cnt = 0 +for i in range(1, n + 1): +    temp = sum(digit_list(i)) +    if a <= temp <= b: +        cnt += i +print(cnt)