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

ans=0

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

  s=list(map(int,str(i)))

  s=sum(s)

  if A<=s and s<=B:

    ans+=i

print(ans)

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

ans = 0

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

    k = i

    tmp = 0

    while k > 0:

        tmp += k % 10

        k = k // 10

    if tmp >= A and tmp <= B:

        ans += i

print(ans)

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

N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    k = i
    tmp = 0
    while k > 0:
        tmp += k % 10
        k = k // 10
    if tmp >= A and tmp <= B:
        ans += i
print(ans)

-    s = list(map(int, str(i))) -    s = sum(s) -    if A <= s and s <= B: +    k = i +    tmp = 0 +    while k > 0: +        tmp += k % 10 +        k = k // 10 +    if tmp >= A and tmp <= B: