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(n):
    x = 0
    y = i
    while y>0:
        x += y%10
        y //=10
    if a <= x <= b:
        ans += i

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

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

print(ans)