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

c=0

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

  x=0

  y=list(str(i))

  for j in range(len(y)):

    x+=int(y[j])

  if a<=x and x<=b:

    c+=i

print(c)
# 入力

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



c=0

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

  y=list(str(x))



  # 各桁の和を求める

  z=sum([int(a) for a in y])



  # 各桁の和がA以上B以下なら加算

  if A<=z and z<=B:

    c+=x



# 出力

print(c)
n, a, b = list(map(int, input().split()))
c = 0
for i in range(1, n + 1):
    x = 0
    y = list(str(i))
    for j in range(len(y)):
        x += int(y[j])
    if a <= x and x <= b:
        c += i
print(c)

# 入力
N, A, B = list(map(int, input().split()))
c = 0
for x in range(1, N + 1):
    y = list(str(x))
    # 各桁の和を求める
    z = sum([int(a) for a in y])
    # 各桁の和がA以上B以下なら加算
    if A <= z and z <= B:
        c += x
# 出力
print(c)

-n, a, b = list(map(int, input().split())) +# 入力 +N, A, B = list(map(int, input().split())) -for i in range(1, n + 1): -    x = 0 -    y = list(str(i)) -    for j in range(len(y)): -        x += int(y[j]) -    if a <= x and x <= b: -        c += i +for x in range(1, N + 1): +    y = list(str(x)) +    # 各桁の和を求める +    z = sum([int(a) for a in y]) +    # 各桁の和がA以上B以下なら加算 +    if A <= z and z <= B: +        c += x +# 出力