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).
n,a,b = map(int,input().split())
count = 0

for i in range(n+1):
    sum = 0
    n_list = list(str(i))
    for j in range(len(n_list)):
        sum += int(n_list[j])
    
    if (sum >= a) and (sum <= b):
        count += 1
    else:
        pass

print(count)
n,a,b = map(int,input().split())
all_sum = 0

for i in range(n+1):
    sum = 0
    n_list = list(str(i))
    for j in range(len(n_list)):
        sum += int(n_list[j])
    
    if (sum >= a) and (sum <= b):
        all_sum += i
    else:
        pass

print(all_sum)