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

ans = 0



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

  i_str = str(i)

  i_len = len(i_str)

  sum = 0

  for j in range(i_len):

    sum += int(i_str[j])

  if sum >= A and sum <= B:

    ans += i

    

print(ans)
#定石の商と剰余でやってみた



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

ans = 0



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

  n = i

  sum = 0

  while n > 0:

    sum += n % 10

    n = n // 10

  if sum >= A and sum <= B:

    ans += i

    

print(ans)
N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    i_str = str(i)
    i_len = len(i_str)
    sum = 0
    for j in range(i_len):
        sum += int(i_str[j])
    if sum >= A and sum <= B:
        ans += i
print(ans)

# 定石の商と剰余でやってみた
N, A, B = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    n = i
    sum = 0
    while n > 0:
        sum += n % 10
        n = n // 10
    if sum >= A and sum <= B:
        ans += i
print(ans)

+# 定石の商と剰余でやってみた -    i_str = str(i) -    i_len = len(i_str) +    n = i -    for j in range(i_len): -        sum += int(i_str[j]) +    while n > 0: +        sum += n % 10 +        n = n // 10