import sys

# import collections

# import math

# import string

# import bisect

# import re

# import itertools

# import statistics



def main():

    n, a, b = (int(x) for x in sys.stdin.read().split())

    total = 0

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

        s = sum(list(int(x) for x in str(i)))

        if a <= s <= b: total += i

    print(total)



if __name__ == "__main__":

    # execute only if run as a script

    main()

import sys



n, a, b = list(map(int, sys.stdin.readline().split()))



def main():

    res = 0

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

        s = sum([int(d) for d in str(i)])

        if a <= s <= b:

            res += i

    return res

    

if __name__ == '__main__':

    ans = main()

    print(ans)
import sys

# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
def main():
    n, a, b = (int(x) for x in sys.stdin.read().split())
    total = 0
    for i in range(1, n + 1):
        s = sum(list(int(x) for x in str(i)))
        if a <= s <= b:
            total += i
    print(total)


if __name__ == "__main__":
    # execute only if run as a script
    main()

import sys

n, a, b = list(map(int, sys.stdin.readline().split()))


def main():
    res = 0
    for i in range(1, n + 1):
        s = sum([int(d) for d in str(i)])
        if a <= s <= b:
            res += i
    return res


if __name__ == "__main__":
    ans = main()
    print(ans)

-# import collections -# import math -# import string -# import bisect -# import re -# import itertools -# import statistics +n, a, b = list(map(int, sys.stdin.readline().split())) + + -    n, a, b = (int(x) for x in sys.stdin.read().split()) -    total = 0 +    res = 0 -        s = sum(list(int(x) for x in str(i))) +        s = sum([int(d) for d in str(i)]) -            total += i -    print(total) +            res += i +    return res -    # execute only if run as a script -    main() +    ans = main() +    print(ans)