ans=0

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

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

    s=list(str(i))

    s1=list(map(int, list(s)))

    tmp=sum(s1)

    if a<=tmp<=b:

        ans+=int("".join(s))

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

print((sum(i for i in range(n+1) if a<=sum(map(int,str(i)))<=b)))
ans = 0
n, a, b = list(map(int, input().split()))
for i in range(1, n + 1):
    s = list(str(i))
    s1 = list(map(int, list(s)))
    tmp = sum(s1)
    if a <= tmp <= b:
        ans += int("".join(s))
print(ans)

n, a, b = list(map(int, input().split()))
print((sum(i for i in range(n + 1) if a <= sum(map(int, str(i))) <= b)))

-ans = 0 -for i in range(1, n + 1): -    s = list(str(i)) -    s1 = list(map(int, list(s))) -    tmp = sum(s1) -    if a <= tmp <= b: -        ans += int("".join(s)) -print(ans) +print((sum(i for i in range(n + 1) if a <= sum(map(int, str(i))) <= b)))