#083 B

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

ans = 0

for i in range(N+1):

    tmp=0



    for j in range(len(str(i))):

        tmp+=int(str(i)[j])

    if A<=tmp<=B:

        ans +=i

print(ans)
# B - Some Sums

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

cnt = 0

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

    tmp = sum([int(i) for i in str(n)])

    if A<=tmp and tmp <= B:

        cnt+=n

print(cnt)
# 083 B
N, A, B = list(map(int, input().split()))
ans = 0
for i in range(N + 1):
    tmp = 0
    for j in range(len(str(i))):
        tmp += int(str(i)[j])
    if A <= tmp <= B:
        ans += i
print(ans)

# B - Some Sums
N, A, B = list(map(int, input().split()))
cnt = 0
for n in range(1, N + 1):
    tmp = sum([int(i) for i in str(n)])
    if A <= tmp and tmp <= B:
        cnt += n
print(cnt)

-# 083 B +# B - Some Sums -ans = 0 -for i in range(N + 1): -    tmp = 0 -    for j in range(len(str(i))): -        tmp += int(str(i)[j]) -    if A <= tmp <= B: -        ans += i -print(ans) +cnt = 0 +for n in range(1, N + 1): +    tmp = sum([int(i) for i in str(n)]) +    if A <= tmp and tmp <= B: +        cnt += n +print(cnt)