Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).
num = input().split(" ")
N=int(num[0])
A=int(num[1])
B=int(num[2])

num = 0
for i in range(1,N+1):
    s = str(i)
    t=0
    for ii in s:
        t+=int(ii)
    if t>=A and t<=B:
        num+=1
print(num)
num = input().split(" ")
N=int(num[0])
A=int(num[1])
B=int(num[2])

num = 0
for i in range(1,N+1):
    s = str(i)
    t=0
    for ii in s:
        t+=int(ii)
    if t>=A and t<=B:
        num+=i
print(num)