'use strict'

function main(input) {
  input = input
    .trim()
    .split(' ')
    .map(Number)

  const n = input[0]
  const a = input[1]
  const b = input[2]
  const arr = []
  for (let i = 1; i <= n; i++) {
    const tmp = i
      .toString()
      .split('')
      .map(Number)
      .reduce((a, b) => a + b)
    // console.log(tmp)
    if (tmp >= a && tmp <= b) arr.push(i)
  }
  // console.log(arr)
  const ans = arr.reduce((a, b) => a + b)

  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))