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 = input().split()
S = 0
C = 0

for j in range(1,int(n)+1): 
  j = str(j)
  for i in range(len(j)): 
    S += int(j[i])
  if int(a) <= S <= int(b):
    C += int(j)
  else:
    C += 0

print(C)
n,a,b = map(int,input().split())
s = 0
for i in range(n+1):
    if a <= sum([int(j) for j in str(i)]) <= b:
        s += i
print(s)