'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ');
  const n = Number(s[0]);
  const a = Number(s[1]);
  const b = Number(s[2]);
  let sum = 0;

  for (var i = 1; i <= n; i++) {
    const num = String(i).split('')
                         .map(x => Number(x))
                         .reduce((a, b) => a + b);
    if (a <= num && num <= b) sum += i;
  }

  console.log(sum);
}

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