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

ans = 0



for i in range(n+1):

    keta_wa = 0

    x = i

    while x != 0:

        keta_wa += int(x % 10)

        x /= 10

        #print(keta_wa,x)

    

    if a <= keta_wa <= b:

        ans += i 



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

ans = 0



for i in range(n+1):

    keta_wa = 0

    x = i

    while x != 0:

        keta_wa += int(x % 10)

        x = int(x /10)

        #print(keta_wa,x)

    

    if a <= keta_wa <= b:

        ans += i 



print(ans)
n, a, b = list(map(int, input().split()))
ans = 0
for i in range(n + 1):
    keta_wa = 0
    x = i
    while x != 0:
        keta_wa += int(x % 10)
        x /= 10
        # print(keta_wa,x)
    if a <= keta_wa <= b:
        ans += i
print(ans)

n, a, b = list(map(int, input().split()))
ans = 0
for i in range(n + 1):
    keta_wa = 0
    x = i
    while x != 0:
        keta_wa += int(x % 10)
        x = int(x / 10)
        # print(keta_wa,x)
    if a <= keta_wa <= b:
        ans += i
print(ans)

-        x /= 10 +        x = int(x / 10)