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

ans=0

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

    s=str(i)

    t=0

    for ss in s:

        t+=int(ss)

    if a<=t<=b:

        ans+=int(i)

print(ans)



def sumdidits(x):

  res=0

  while x:

    res+=x%10

    x//=10

  return res



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

ans=0

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

  t=sumdidits(i)

  if a<=t<=b:

    ans+=i

print(ans)
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    s = str(i)
    t = 0
    for ss in s:
        t += int(ss)
    if a <= t <= b:
        ans += int(i)
print(ans)

def sumdidits(x):
    res = 0
    while x:
        res += x % 10
        x //= 10
    return res


n, a, b = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    t = sumdidits(i)
    if a <= t <= b:
        ans += i
print(ans)

+def sumdidits(x): +    res = 0 +    while x: +        res += x % 10 +        x //= 10 +    return res + + -    s = str(i) -    t = 0 -    for ss in s: -        t += int(ss) +    t = sumdidits(i) -        ans += int(i) +        ans += i