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

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





def num_sum(n):

    p = list(map(int, str(n)[::-1]))

    _sum = 0

    for _i in range(len(p)):

        _sum += p[_i]

    return _sum





ans = 0

for i in range(N+1):

    if A <= num_sum(i) <= B:

        ans += i



print(ans)

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



ans = 0

for i in range(N+1):

    if A <= sum(list(map(int, str(i)[::]))) <= B:

        ans += i



print(ans)

# -*- coding: utf-8 -*-
N, A, B = list(map(int, input().split()))


def num_sum(n):
    p = list(map(int, str(n)[::-1]))
    _sum = 0
    for _i in range(len(p)):
        _sum += p[_i]
    return _sum


ans = 0
for i in range(N + 1):
    if A <= num_sum(i) <= B:
        ans += i
print(ans)

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

-# -*- coding: utf-8 -*- - - -def num_sum(n): -    p = list(map(int, str(n)[::-1])) -    _sum = 0 -    for _i in range(len(p)): -        _sum += p[_i] -    return _sum - - -    if A <= num_sum(i) <= B: +    if A <= sum(list(map(int, str(i)[::]))) <= B: