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

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



ans = 0

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

    tmp = i

    tmp2 = list(str(tmp))

    sum = 0

    for j in range(len(tmp2)):

        sum += int(tmp2[j])

    if a <= sum <= b:

        ans += i

print(ans)

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

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



ans = 0

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

    tmp = str(i)

    su = 0

    for j in tmp:

        su += int(j)

    #print(i, su)

    if a <= su <= b:

        ans += i

print(ans)

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

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

-    tmp = i -    tmp2 = list(str(tmp)) -    sum = 0 -    for j in range(len(tmp2)): -        sum += int(tmp2[j]) -    if a <= sum <= b: +    tmp = str(i) +    su = 0 +    for j in tmp: +        su += int(j) +    # print(i, su) +    if a <= su <= b: