"use strict";
    
const main = arg => {
    const N  = arg.split("\n")[0].split(" ")[0];
    const A  = arg.split("\n")[0].split(" ")[1];
    const B  = arg.split("\n")[0].split(" ")[2];
    let list = [];
    
    for(let i=1; i<=N; i++) {
        let sum = parseInt(String(i).split("").reduce((m,n)=>parseInt(m)+parseInt(n)));
        if(sum >= A && sum <= B) list.push(i);
    }
    
    console.log(list.reduce((m,n)=>m+n));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));