# -*- coding: utf-8 -*-



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



s = 0



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

    if a <= sum(map(int, str(i))) <=b:

        s += i



print(s)

# -*- coding: utf-8 -*-



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



s = 0



print((sum(i if a <= sum(map(int, str(i))) <=b else 0

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

# -*- coding: utf-8 -*-
n, a, b = list(map(int, input().split()))
s = 0
for i in range(1, n + 1):
    if a <= sum(map(int, str(i))) <= b:
        s += i
print(s)

# -*- coding: utf-8 -*-
n, a, b = list(map(int, input().split()))
s = 0
print((sum(i if a <= sum(map(int, str(i))) <= b else 0 for i in range(1, n + 1))))

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