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

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



res = 0



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

    count = 0

    for j in range(len(str(i))):

        count += int(str(i)[j])

    if A <= count <= B:

        res += i

print(res)

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



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

ans = 0



for i in range(n+1):

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

        ans += i

print(ans)

# -*- coding:utf-8 -*-
N, A, B = list(map(int, input().split()))
res = 0
for i in range(1, N + 1):
    count = 0
    for j in range(len(str(i))):
        count += int(str(i)[j])
    if A <= count <= B:
        res += i
print(res)

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

-N, A, B = list(map(int, input().split())) -res = 0 -for i in range(1, N + 1): -    count = 0 -    for j in range(len(str(i))): -        count += int(str(i)[j]) -    if A <= count <= B: -        res += i -print(res) +n, a, b = list(map(int, input().split())) +ans = 0 +for i in range(n + 1): +    if a <= sum(list(map(int, list(str(i))))) <= b: +        ans += i +print(ans)