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())
ans = 0
for i in range(1, N+1):
  if A <= sum(map(int, list(str(i)))) <= B:
    ans += 1

print(ans)
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  if A <= sum(map(int, list(str(i)))) <= B:
    ans += i

print(ans)