n,a,b=list(map(int,input().split()));print((sum(i*(a<=sum(map(int,str(i)))<=b)for i in range(n+1))))
n,a,b=list(map(int,input().split()));c=0

while n:c+=n*(a<=sum(map(int,str(n)))<=b);n-=1

print(c)
n, a, b = list(map(int, input().split()))
print((sum(i * (a <= sum(map(int, str(i))) <= b) for i in range(n + 1))))

n, a, b = list(map(int, input().split()))
c = 0
while n:
    c += n * (a <= sum(map(int, str(n))) <= b)
    n -= 1
print(c)

-print((sum(i * (a <= sum(map(int, str(i))) <= b) for i in range(n + 1)))) +c = 0 +while n: +    c += n * (a <= sum(map(int, str(n))) <= b) +    n -= 1 +print(c)