def ketanowa(p):

    ans=0

    p=str(p)

    for i in p:

        ans+=int(i)

    return ans



def main():

    temp=input().split(" ")

    n=int(temp[0])

    a=int(temp[1])

    b=int(temp[2])

    su=0





    for i in range(n+1):

        if  a<=ketanowa(i) and ketanowa(i)<=b:

            su+=i

    print (su)



if __name__ == '__main__':

    main()

a,b,c=input().split(" ")

nums=[]

ans=0

b=int(b)

c=int(c)

a=int(a)

for i in range(a+1):

  nums.append(sum(list(map(int,str(i)))))

for j,n in enumerate(nums):

  if b<=n and n<=c:

    ans+=j

print(ans)
def ketanowa(p):
    ans = 0
    p = str(p)
    for i in p:
        ans += int(i)
    return ans


def main():
    temp = input().split(" ")
    n = int(temp[0])
    a = int(temp[1])
    b = int(temp[2])
    su = 0
    for i in range(n + 1):
        if a <= ketanowa(i) and ketanowa(i) <= b:
            su += i
    print(su)


if __name__ == "__main__":
    main()

a, b, c = input().split(" ")
nums = []
ans = 0
b = int(b)
c = int(c)
a = int(a)
for i in range(a + 1):
    nums.append(sum(list(map(int, str(i)))))
for j, n in enumerate(nums):
    if b <= n and n <= c:
        ans += j
print(ans)

-def ketanowa(p): -    ans = 0 -    p = str(p) -    for i in p: -        ans += int(i) -    return ans - - -def main(): -    temp = input().split(" ") -    n = int(temp[0]) -    a = int(temp[1]) -    b = int(temp[2]) -    su = 0 -    for i in range(n + 1): -        if a <= ketanowa(i) and ketanowa(i) <= b: -            su += i -    print(su) - - -if __name__ == "__main__": -    main() +a, b, c = input().split(" ") +nums = [] +ans = 0 +b = int(b) +c = int(c) +a = int(a) +for i in range(a + 1): +    nums.append(sum(list(map(int, str(i))))) +for j, n in enumerate(nums): +    if b <= n and n <= c: +        ans += j +print(ans)