import sys

def input(): return sys.stdin.readline().strip()



def resolve():

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

    l=[]

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

        cnt=0

        for j in range(len(str(i))):

            cnt+=int(str(i)[j])

        if a<=cnt<=b:

            l.append(i)

    print((sum(l)))

resolve()


import sys

def input(): return sys.stdin.readline().strip()



def resolve():

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

    ans=0

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

        cnt=0

        for j in str(i):

            cnt+=int(j)

        if a<=cnt<=b:

            ans+=i

    print(ans)

resolve()
import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    n, a, b = list(map(int, input().split()))
    l = []
    for i in range(1, n + 1):
        cnt = 0
        for j in range(len(str(i))):
            cnt += int(str(i)[j])
        if a <= cnt <= b:
            l.append(i)
    print((sum(l)))


resolve()

import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    n, a, b = list(map(int, input().split()))
    ans = 0
    for i in range(1, n + 1):
        cnt = 0
        for j in str(i):
            cnt += int(j)
        if a <= cnt <= b:
            ans += i
    print(ans)


resolve()

-    l = [] +    ans = 0 -        for j in range(len(str(i))): -            cnt += int(str(i)[j]) +        for j in str(i): +            cnt += int(j) -            l.append(i) -    print((sum(l))) +            ans += i +    print(ans)