#import <Foundation/Foundation.h>
#import <stdarg.h>

@interface StdIO : NSObject
+(NSMutableString*)stringFromStdIn;
+(void)printf:(NSString*)format, ...;
@end
@implementation StdIO
+(NSMutableString*)stringFromStdIn
{
    NSFileHandle *handle = [NSFileHandle fileHandleWithStandardInput];
    NSMutableString *result = [NSMutableString string];
    NSData *data = [handle availableData];
    while ([data length] > 0) {
        [result appendString:[[[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding] autorelease]];
        data = [handle availableData];
    }
    return result;
}
+(void)printf:(NSString*)format, ...
{
    va_list arguments;
    va_start(arguments, format);
    NSString *string = [[[NSString alloc] initWithFormat: format arguments: arguments] autorelease];
    NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardOutput];
    [fileHandle writeData:[string dataUsingEncoding: NSUTF8StringEncoding]];
    va_end(arguments);
}
@end
  
@interface NSString (Extension)
-(NSArray*)characters;
@end

@implementation NSString (Extension)
-(NSArray*)characters
{
    NSMutableArray *result = [NSMutableArray array];
    for (NSUInteger i=0; i < [self length]; i++) {
        [result addObject:[NSString stringWithFormat:@"%C", [self characterAtIndex:i]]];
    }
    return result;
}
@end

int main() {
    @autoreleasepool {
        NSArray *numbers = [[StdIO stringFromStdIn] componentsSeparatedByString:@" "];
        NSInteger N = [[numbers objectAtIndex:0] integerValue];
        NSInteger A = [[numbers objectAtIndex:1] integerValue];
        NSInteger B = [[numbers objectAtIndex:2] integerValue];
        NSInteger result = 0;
        for (NSInteger i=1; i<=N; i++) {
            NSArray *digits = [[NSString stringWithFormat:@"%ld", i] characters];
            NSInteger sum = 0;
            for (NSString *digit in digits) {
                sum += [digit integerValue];
            }
            if (A<=sum && sum<=B) {
                result += i;
            }
        }
        [StdIO printf: @"%ld", result];
    }
    return 0;
}
