# coding: utf-8

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

ans = 0

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

    z = str(x)

    sum_x = sum(int(y) for y in z)

    if A <= sum_x <= B:

        ans += x

print(ans)
# coding: utf-8

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

ans = 0

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

    sum_x = sum(map(int, str(x)))

    if A <= sum_x <= B:

        ans += x

print(ans)
# coding: utf-8
N, A, B = list(map(int, input().split()))
ans = 0
for x in range(1, N + 1):
    z = str(x)
    sum_x = sum(int(y) for y in z)
    if A <= sum_x <= B:
        ans += x
print(ans)

# coding: utf-8
N, A, B = list(map(int, input().split()))
ans = 0
for x in range(1, N + 1):
    sum_x = sum(map(int, str(x)))
    if A <= sum_x <= B:
        ans += x
print(ans)

-    z = str(x) -    sum_x = sum(int(y) for y in z) +    sum_x = sum(map(int, str(x)))