def degitsum(n):

    ans = 0

    while n/10 != 0:

        ans += n%10

        n = int(n/10)

    return ans



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



ans = 0

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

    if a <= degitsum(i) <= b:

        ans += i

    else:

        continue

        

print(ans)
# B

# 2020/03/06 14:34-

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



def SumDegit(x):

    ans = 0

    while x > 0:

        ans += x%10

        x = x//10

    return ans



ans = 0

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

    if a <= SumDegit(i) <= b:

        ans += i

        

print(ans)
def degitsum(n):
    ans = 0
    while n / 10 != 0:
        ans += n % 10
        n = int(n / 10)
    return ans


n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    if a <= degitsum(i) <= b:
        ans += i
    else:
        continue
print(ans)

# B
# 2020/03/06 14:34-
n, a, b = list(map(int, input().split()))


def SumDegit(x):
    ans = 0
    while x > 0:
        ans += x % 10
        x = x // 10
    return ans


ans = 0
for i in range(1, n + 1):
    if a <= SumDegit(i) <= b:
        ans += i
print(ans)

-def degitsum(n): +# B +# 2020/03/06 14:34- +n, a, b = list(map(int, input().split())) + + +def SumDegit(x): -    while n / 10 != 0: -        ans += n % 10 -        n = int(n / 10) +    while x > 0: +        ans += x % 10 +        x = x // 10 -n, a, b = list(map(int, input().split())) -    if a <= degitsum(i) <= b: +    if a <= SumDegit(i) <= b: -    else: -        continue