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())

cand = list(range(1, N+1))
cand = list(map(str, cand))
cand = list(map(lambda x: sum(map(int, x)), cand))
cand = list(map(lambda x: x if A <= x <= B else 0, cand))

print(sum(cand))
N,A,B = map(int, input().split())

cand = list(range(1, N+1))
cand = list(map(str, cand))
cand = list(map(lambda x: sum(map(int, x)), cand))
cand = list(map(lambda x: True if A <= x <= B else False, cand))

target = [x for x,t in zip(list(range(1, N+1)), cand) if t]
print(sum(target))