'use strict';
function main(input) {
    const args = input.split(' ').map((n) => parseInt(n, 10));
	let total = 0
	for(let i = 0;i <= args[0]; i++) {
    	const re = String(i).split('').map(x=> Number(x)).reduce((a, b)=>a+b)
        if(args[1] <= re && re <= args[2]) total = total + i
    }
  	console.log(total)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));