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

ans=0

for i in range(n+1):

    l=[int(x) for x in list(str(i))]

    if a<=sum(l)<=b:

        ans+=i

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

total=0

for i in range(n+1):

    ans=list(str(i))

    ans_2=sum(map(int,ans))

    if a<=ans_2<=b:

        total+=i

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

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

-ans = 0 +total = 0 -    l = [int(x) for x in list(str(i))] -    if a <= sum(l) <= b: -        ans += i -print(ans) +    ans = list(str(i)) +    ans_2 = sum(map(int, ans)) +    if a <= ans_2 <= b: +        total += i +print(total)