N, A, B = [int(x) for x in input().split()]



ans = 0



for i in range(1, N + 1):

	s = str(i)

	SUM = 0

	for j in range(len(s)):

		SUM += int(s[j])

	if SUM >= A and SUM <= B:

		ans += i



print(ans)
N, A, B = [int(x) for x in input().split()]



ans = 0



for i in range(1, N + 1):

	SUM = 0

	n = i

	while n > 0:

		SUM += n % 10

		n = n // 10

	if SUM >= A and SUM <= B:

		ans += i



print(ans)
N, A, B = [int(x) for x in input().split()]
ans = 0
for i in range(1, N + 1):
    s = str(i)
    SUM = 0
    for j in range(len(s)):
        SUM += int(s[j])
    if SUM >= A and SUM <= B:
        ans += i
print(ans)

N, A, B = [int(x) for x in input().split()]
ans = 0
for i in range(1, N + 1):
    SUM = 0
    n = i
    while n > 0:
        SUM += n % 10
        n = n // 10
    if SUM >= A and SUM <= B:
        ans += i
print(ans)

-    s = str(i) -    for j in range(len(s)): -        SUM += int(s[j]) +    n = i +    while n > 0: +        SUM += n % 10 +        n = n // 10