import std.stdio : writeln;

void main() {
    int n,a,b;
    scan(n,a,b);

    long ans;

    foreach (i ; 1 .. n + 1) {
        int d = digitSum(i);
        
        if (a <= d && d <= b) {
            ans += i;
        }
    }

    writeln(ans);
}

int digitSum(int x) {
    return x > 0 ? digitSum(x / 10) + x % 10 : 0;
}




void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.array : split;
    import std.conv  : to;
    import std.range.primitives;

    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
