N, A, B = list(map(int, input().split()))



print((sum(i for i in range(1, N+1) if A <= sum(int(c) for c in str(i)) <= B)))

N, A, B = list(map(int, input().split()))



print((sum(i for i in range(1, N+1) if A <= sum(map(int, str(i))) <= B)))

N, A, B = list(map(int, input().split()))
print((sum(i for i in range(1, N + 1) if A <= sum(int(c) for c in str(i)) <= B)))

N, A, B = list(map(int, input().split()))
print((sum(i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B)))

-print((sum(i for i in range(1, N + 1) if A <= sum(int(c) for c in str(i)) <= B))) +print((sum(i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B)))