"use strict";
// import bigInt from 'big-integer'

const Main = input => {
  input = input.trim().split(" ");
  const loop = input[0];
  const low = input[1];
  const high = input[2];

  let total = 0;
  for (let i = 0; i <= loop; i++) {
    const num = i
      .toString()
      .split("")
      .reduce((acc, cur) => acc + parseInt(cur, 10), 0);
    if (low <= num && num <= high) total += i;
  }

  console.log(total);
};

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