n,a,b = input().split()

C = 0



for j in range(1,int(n)+1): #1<=j<=nを出力

  j = str(j)

  S = 0

  for i in range(len(j)): #整数の各位の和を求める

    S += int(j[i])

  if int(a) <= S <= int(b): #a<=S<=bに収まるかどうかでCに加算するか判別

    C += int(j)

  else:

    C += 0



print(C)
N, A, B = list(map(int, input().split()))

res = 0

for i in range(N+1):

    if A <= sum([int(s) for s in str(i)]) <= B:

        res += i

print(res)
n, a, b = input().split()
C = 0
for j in range(1, int(n) + 1):  # 1<=j<=nを出力
    j = str(j)
    S = 0
    for i in range(len(j)):  # 整数の各位の和を求める
        S += int(j[i])
    if int(a) <= S <= int(b):  # a<=S<=bに収まるかどうかでCに加算するか判別
        C += int(j)
    else:
        C += 0
print(C)

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

-n, a, b = input().split() -C = 0 -for j in range(1, int(n) + 1):  # 1<=j<=nを出力 -    j = str(j) -    S = 0 -    for i in range(len(j)):  # 整数の各位の和を求める -        S += int(j[i]) -    if int(a) <= S <= int(b):  # a<=S<=bに収まるかどうかでCに加算するか判別 -        C += int(j) -    else: -        C += 0 -print(C) +N, A, B = list(map(int, input().split())) +res = 0 +for i in range(N + 1): +    if A <= sum([int(s) for s in str(i)]) <= B: +        res += i +print(res)