N, A, B = (int(c) for c in input().split(" "))


def sum_digits(n):
    s = 0
    while n > 0:
        s += n % 10
        n //= 10
    return s


ans = 0
for i in range(1, N + 1):
    d = sum_digits(i)
    if A <= d <= B:
        ans += i

print(ans)
