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):
    temp = 0
    hoge = i
    while hoge > 0:
        temp += hoge % 10
        hoge //= 10
    if a <= temp <= b:
        ans += 1

print(ans)

n, a, b = map(int, input().split())

ans = 0
for i in range(1, n + 1):
    temp = 0
    hoge = i
    while hoge > 0:
        temp += hoge % 10
        hoge //= 10
    if a <= temp <= b:
        ans += i

print(ans)
