#!/usr/bin/env python

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



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



r = 0

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

    s = sum(list(map(int, list(str(n)))))

    if A <= s <= B:

        r += n



print(r)

import sys





def sum_digits(n):

    r = 0

    while n > 0:

        r += n % 10

        n = int(n / 10)

    return r





def solve(inp):

    (N, A, B) = list(map(int, inp.readline().split(' ')))



    r = 0

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

        s = sum_digits(n)

        if A <= s <= B:

            r += n



    return r





def main():

    result = solve(sys.stdin)

    if result:

        print(result)





if __name__ == '__main__':

    main()

#!/usr/bin/env python
# -*- coding: utf-8 -*-
(N, A, B) = list(map(int, input().split(" ")))
r = 0
for n in range(1, N + 1):
    s = sum(list(map(int, list(str(n)))))
    if A <= s <= B:
        r += n
print(r)

import sys


def sum_digits(n):
    r = 0
    while n > 0:
        r += n % 10
        n = int(n / 10)
    return r


def solve(inp):
    (N, A, B) = list(map(int, inp.readline().split(" ")))
    r = 0
    for n in range(1, N + 1):
        s = sum_digits(n)
        if A <= s <= B:
            r += n
    return r


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == "__main__":
    main()

-#!/usr/bin/env python -# -*- coding: utf-8 -*- -(N, A, B) = list(map(int, input().split(" "))) -r = 0 -for n in range(1, N + 1): -    s = sum(list(map(int, list(str(n))))) -    if A <= s <= B: -        r += n -print(r) +import sys + + +def sum_digits(n): +    r = 0 +    while n > 0: +        r += n % 10 +        n = int(n / 10) +    return r + + +def solve(inp): +    (N, A, B) = list(map(int, inp.readline().split(" "))) +    r = 0 +    for n in range(1, N + 1): +        s = sum_digits(n) +        if A <= s <= B: +            r += n +    return r + + +def main(): +    result = solve(sys.stdin) +    if result: +        print(result) + + +if __name__ == "__main__": +    main()