def sums(n):

    return(sum(list(map(int,[str(n)[i] for i in range(len(str(n)))]))))





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

ans=0

for j in range(n+1):

    if sums(j)>=a and sums(j)<=b:

        ans+=j



print(ans)

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



ans=0

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

    i=str(i)

    m=0

    for j in range(len(i)):

        m+=int(i[j])

    if m>=a and m<=b:

        ans+=int(i)



print(ans)

def sums(n):
    return sum(list(map(int, [str(n)[i] for i in range(len(str(n)))])))


n, a, b = list(map(int, input().split()))
ans = 0
for j in range(n + 1):
    if sums(j) >= a and sums(j) <= b:
        ans += j
print(ans)

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

-def sums(n): -    return sum(list(map(int, [str(n)[i] for i in range(len(str(n)))]))) - - -for j in range(n + 1): -    if sums(j) >= a and sums(j) <= b: -        ans += j +for i in range(1, n + 1): +    i = str(i) +    m = 0 +    for j in range(len(i)): +        m += int(i[j]) +    if m >= a and m <= b: +        ans += int(i)