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



target_total = 0



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

    total_each_digit = 0

    n_length = len(str(n))

    

    for i in range(n_length):

        total_each_digit += int(str(n)[i])

    if A <= total_each_digit <= B:

        target_total += n



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



target_total = 0    # 加算対象の数値の和



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

    total_each_digit = 0    # 各位の和      

    str_n = str(n)

    n_length = len(str_n)  # nの桁数

    

    for i in range(n_length):

        total_each_digit += int(str_n[i])



    if A <= total_each_digit <= B:

        target_total += n



print(target_total)
N, A, B = list(map(int, input().split()))
target_total = 0
for n in range(1, N + 1):
    total_each_digit = 0
    n_length = len(str(n))
    for i in range(n_length):
        total_each_digit += int(str(n)[i])
    if A <= total_each_digit <= B:
        target_total += n
print(target_total)

N, A, B = list(map(int, input().split()))
target_total = 0  # 加算対象の数値の和
for n in range(1, N + 1):
    total_each_digit = 0  # 各位の和
    str_n = str(n)
    n_length = len(str_n)  # nの桁数
    for i in range(n_length):
        total_each_digit += int(str_n[i])
    if A <= total_each_digit <= B:
        target_total += n
print(target_total)

-target_total = 0 +target_total = 0  # 加算対象の数値の和 -    total_each_digit = 0 -    n_length = len(str(n)) +    total_each_digit = 0  # 各位の和 +    str_n = str(n) +    n_length = len(str_n)  # nの桁数 -        total_each_digit += int(str(n)[i]) +        total_each_digit += int(str_n[i])