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



ans = []

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

    num = 0

    for j in str(i):

        num += int(j)

    if a <= num <= b:

        ans.append(i)

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



ans = 0

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

    # i = 10

    n1 = i

    n2 = 0

    while n1 != 0:

        n2 += n1%10

        n1 = n1//10

    if a <= n2 <= b:

        ans += i



print(ans)

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

n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    # i = 10
    n1 = i
    n2 = 0
    while n1 != 0:
        n2 += n1 % 10
        n1 = n1 // 10
    if a <= n2 <= b:
        ans += i
print(ans)

-ans = [] +ans = 0 -    num = 0 -    for j in str(i): -        num += int(j) -    if a <= num <= b: -        ans.append(i) -print((sum(ans))) +    # i = 10 +    n1 = i +    n2 = 0 +    while n1 != 0: +        n2 += n1 % 10 +        n1 = n1 // 10 +    if a <= n2 <= b: +        ans += i +print(ans)