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())
print(N, A, B)
ans = 0
for i in range(N+1):
    youso_wa = 0
    a = i
    while True:
        amari = int(a % 10)
        a = int(a / 10)
        youso_wa += amari
        if a == 0:
            break
    if youso_wa >= A and youso_wa <= B:
        ans += i
print(ans)
N, A, B = map(int, input().split())
ans = 0
for i in range(N+1):
    youso_wa = 0
    a = i
    while True:
        youso_wa += int(a % 10)
        a = int(a / 10)
        if a == 0:
            break
    if youso_wa >= A and youso_wa <= B:
        ans += i
print(ans)