N, A, B = map(int, input().split())
print(sum(i * (A <= sum(map(int, str(i))) <= B) for i in range(N + 1)))

0d6faeab7d9fcca8a47204a9c502f6b7f3783d87
<mask token>

<mask token>
print(sum(i * (A <= sum(map(int, str(i))) <= B) for i in range(N + 1)))

N, A, B = map(int, input().split())
print(sum(i * (A <= sum(map(int, str(i))) <= B) for i in range(N + 1)))
