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

ans = 0

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

  c = 0

  s = str(i)

  for j in s:

    c += int(j)

  if a <= c <= b:

    ans += i

    

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

ans = 0

for i in range(n):

  t = i+1

  cnt = 0

  while t:

    cnt += t%10

    t //= 10

  if a <= cnt <= b:

    ans += i+1

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

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

-for i in range(1, n + 1): -    c = 0 -    s = str(i) -    for j in s: -        c += int(j) -    if a <= c <= b: -        ans += i +for i in range(n): +    t = i + 1 +    cnt = 0 +    while t: +        cnt += t % 10 +        t //= 10 +    if a <= cnt <= b: +        ans += i + 1