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

r = 0

for i in range(n+1):

    if a <= sum(list(map(int,list(str(i))))) <= b: r += i

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

def ketawa(i):

  ret = 0

  while(i):

    ret += i % 10

    i //= 10

  return ret



ret = 0

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

  if a <= ketawa(i) <= b: ret += i

print(ret)

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

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


def ketawa(i):
    ret = 0
    while i:
        ret += i % 10
        i //= 10
    return ret


ret = 0
for i in range(1, n + 1):
    if a <= ketawa(i) <= b:
        ret += i
print(ret)

-r = 0 -for i in range(n + 1): -    if a <= sum(list(map(int, list(str(i))))) <= b: -        r += i -print(r) + + +def ketawa(i): +    ret = 0 +    while i: +        ret += i % 10 +        i //= 10 +    return ret + + +ret = 0 +for i in range(1, n + 1): +    if a <= ketawa(i) <= b: +        ret += i +print(ret)