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

ans = 0

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

    if a <= sum([int(j) for j in str(i)]) <= b:

        ans += i

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

ans = 0





def sum_(m):

    res = 0

    while m > 0:

        res += m % 10

        m //= 10

    return res





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

    # if a <= sum([int(j) for j in str(i)]) <= b:

    if a <= sum_(i) <= b:

            ans += i

print(ans)

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

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


def sum_(m):
    res = 0
    while m > 0:
        res += m % 10
        m //= 10
    return res


for i in range(0, n + 1):
    # if a <= sum([int(j) for j in str(i)]) <= b:
    if a <= sum_(i) <= b:
        ans += i
print(ans)

+ + +def sum_(m): +    res = 0 +    while m > 0: +        res += m % 10 +        m //= 10 +    return res + + -    if a <= sum([int(j) for j in str(i)]) <= b: +    # if a <= sum([int(j) for j in str(i)]) <= b: +    if a <= sum_(i) <= b: