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

 

def check(n,c):

    c+=n%10

    return (c if n/10==0 else check(int(n/10),c))

 

print((sum([i for i in range(1,N+1) if A<=check(i,0)<=B])))



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



print((sum([i for i in range(1,N+1) if A<=sum(map(int,str(i)))<=B])))



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


def check(n, c):
    c += n % 10
    return c if n / 10 == 0 else check(int(n / 10), c)


print((sum([i for i in range(1, N + 1) if A <= check(i, 0) <= B])))

N, A, B = list(map(int, input().split(" ")))
print((sum([i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B])))

- - -def check(n, c): -    c += n % 10 -    return c if n / 10 == 0 else check(int(n / 10), c) - - -print((sum([i for i in range(1, N + 1) if A <= check(i, 0) <= B]))) +print((sum([i for i in range(1, N + 1) if A <= sum(map(int, str(i))) <= B])))