"use strict";

function Main(input) {
  input = input.split(" ");
  let result = 0;
  for (let i = 1; i <= input[0]; i++) {
    let n = String(i).split("");
    let sum = 0;
    for (const m of n) {
      sum = sum + parseInt(m);
    }
    if (sum <= input[2] && sum >= input[1]) {
      result = result + i;
    }
  }
  console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf-8"));
