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 sum(p):

    q=0

    while p>0:

        q+=p%10

        p=p//10

    return(q)



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

ans=0

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

    if sum(i)>=a and sum(i)<=b:

        ans+=i



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 sum(p):
    q = 0
    while p > 0:
        q += p % 10
        p = p // 10
    return q


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

+def sum(p): +    q = 0 +    while p > 0: +        q += p % 10 +        p = p // 10 +    return q + + -    i = str(i) -    m = 0 -    for j in range(len(i)): -        m += int(i[j]) -    if m >= a and m <= b: -        ans += int(i) +    if sum(i) >= a and sum(i) <= b: +        ans += i