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

canditates = [i for i in range(1, n+1) 

              if a <= sum(list(map(int, list(str(i))))) <= b]

print((sum(canditates)))
n, a, b = list(map(int, input().split()))

canditates = [i for i in range(1, n+1) 

              if a <= sum(map(int, list(str(i)))) <= b]

print((sum(canditates)))
n, a, b = list(map(int, input().split()))
canditates = [i for i in range(1, n + 1) if a <= sum(list(map(int, list(str(i))))) <= b]
print((sum(canditates)))

n, a, b = list(map(int, input().split()))
canditates = [i for i in range(1, n + 1) if a <= sum(map(int, list(str(i)))) <= b]
print((sum(canditates)))

-canditates = [i for i in range(1, n + 1) if a <= sum(list(map(int, list(str(i))))) <= b] +canditates = [i for i in range(1, n + 1) if a <= sum(map(int, list(str(i)))) <= b]