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

total = 0

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

  li = list(str(i))

  m = 0

  for j in li:

    m += int(j)

  if a <= m <= b:

    total += i

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

total = 0

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

  m = 0

  ni = i

  while ni > 0:

    m += ni % 10

    ni = ni // 10

  if a <= m <= b:

    total += i

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

n, a, b = list(map(int, input().split()))
total = 0
for i in range(1, n + 1):
    m = 0
    ni = i
    while ni > 0:
        m += ni % 10
        ni = ni // 10
    if a <= m <= b:
        total += i
print(total)

-    li = list(str(i)) -    for j in li: -        m += int(j) +    ni = i +    while ni > 0: +        m += ni % 10 +        ni = ni // 10