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

ans = 0

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

  s = sum(map(int,list(str(i))))

  if a <= s <= b:

    ans += i

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

print((sum(i for i in range(1,n+1) if a <= sum(map(int,str(i))) <= b)))

#map(int,list(str(i)))もmap(int,str(i))も変わらない？前者は１つ前の提出。
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    s = sum(map(int, list(str(i))))
    if a <= s <= b:
        ans += i
print(ans)

n, a, b = list(map(int, input().split()))
print((sum(i for i in range(1, n + 1) if a <= sum(map(int, str(i))) <= b)))
# map(int,list(str(i)))もmap(int,str(i))も変わらない？前者は１つ前の提出。

-ans = 0 -for i in range(1, n + 1): -    s = sum(map(int, list(str(i)))) -    if a <= s <= b: -        ans += i -print(ans) +print((sum(i for i in range(1, n + 1) if a <= sum(map(int, str(i))) <= b))) +# map(int,list(str(i)))もmap(int,str(i))も変わらない？前者は１つ前の提出。