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).
from sys import stdin
N,A,B=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
for i in range(1,N+1):
    digit = list(map(int,str(i)))
    if A <= sum(digit) and sum(digit) <= B:
        ans+=1
print(ans)
from sys import stdin
N,A,B=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
for i in range(1,N+1):
    digit = list(map(int,str(i)))
    if A <= sum(digit) and sum(digit) <= B:
        ans+=i
print(ans)