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

y = 0



for x in range(a):

	if b <= sum(list(map(int, list(str(x+1))))) <= c:y += x + 1

print(y)
a, b, c = list(map(int, input().split()))

total = 0



for x in range(a+1):

  z = x

  d = 0

  while z != 0:

    d += z % 10

    z = z // 10

  if b <= d <= c:total += x

print(total)

a, b, c = list(map(int, input().split()))
y = 0
for x in range(a):
    if b <= sum(list(map(int, list(str(x + 1))))) <= c:
        y += x + 1
print(y)

a, b, c = list(map(int, input().split()))
total = 0
for x in range(a + 1):
    z = x
    d = 0
    while z != 0:
        d += z % 10
        z = z // 10
    if b <= d <= c:
        total += x
print(total)

-y = 0 -for x in range(a): -    if b <= sum(list(map(int, list(str(x + 1))))) <= c: -        y += x + 1 -print(y) +total = 0 +for x in range(a + 1): +    z = x +    d = 0 +    while z != 0: +        d += z % 10 +        z = z // 10 +    if b <= d <= c: +        total += x +print(total)