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

r=0

for i in range(n+1):

    s = 0

    t = str(i)

    k = len(t)

    for j in range(k):

        s +=int(t[j])

    if  a <= s <= b:

        r+=int(t)

print(r)
N,a,b = list(map(int,input().split()))

R = 0

for i in range(N+1):

    s = i

    r = 0

    while i !=0:

        r+= i%10

        i //=10

    if a <= r <= b:

        R+=s

print(R)

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

N, a, b = list(map(int, input().split()))
R = 0
for i in range(N + 1):
    s = i
    r = 0
    while i != 0:
        r += i % 10
        i //= 10
    if a <= r <= b:
        R += s
print(R)

-n, a, b = list(map(int, input().split())) -r = 0 -for i in range(n + 1): -    s = 0 -    t = str(i) -    k = len(t) -    for j in range(k): -        s += int(t[j]) -    if a <= s <= b: -        r += int(t) -print(r) +N, a, b = list(map(int, input().split())) +R = 0 +for i in range(N + 1): +    s = i +    r = 0 +    while i != 0: +        r += i % 10 +        i //= 10 +    if a <= r <= b: +        R += s +print(R)