def sum(i):

  t=0

  while True:

    if i==0:

      return t

    else:

      t +=i%10

      i //=10

      

N,A,B = [int(i) for i in input().split()]

s = 0



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

  if sum(i) <=B and sum(i) >=A:

    s += i

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



answer = 0

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

	sum = 0

	x = i

	while x > 0:

		sum += x % 10

		x = x // 10

	if a <= sum <= b:

		answer += i

print(answer)

def sum(i):
    t = 0
    while True:
        if i == 0:
            return t
        else:
            t += i % 10
            i //= 10


N, A, B = [int(i) for i in input().split()]
s = 0
for i in range(1, N + 1):
    if sum(i) <= B and sum(i) >= A:
        s += i
print(s)

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

-def sum(i): -    t = 0 -    while True: -        if i == 0: -            return t -        else: -            t += i % 10 -            i //= 10 - - -N, A, B = [int(i) for i in input().split()] -s = 0 -for i in range(1, N + 1): -    if sum(i) <= B and sum(i) >= A: -        s += i -print(s) +n, a, b = list(map(int, input().split())) +answer = 0 +for i in range(1, n + 1): +    sum = 0 +    x = i +    while x > 0: +        sum += x % 10 +        x = x // 10 +    if a <= sum <= b: +        answer += i +print(answer)