import std.stdio;
import std.algorithm;
import std.conv;
import std.array;
import std.string;
import std.math;
import std.functional;
import std.range;
import std.typecons;
import std.format;

void main(string[] args) {
  readln.solve.writeln;
}

auto solve(string line1) {
  auto _ = line1.chomp.split.map!(to!int).array;
  int N = _[0];
  int A = _[1];
  int B = _[2];
  long res = 0;

  foreach(d1; 0..2)
  foreach(d2; 0..10)
  foreach(d3; 0..10)
  foreach(d4; 0..10)
  foreach(d5; 0..10) {
    auto dsum = d1 + d2 + d3 + d4 + d5;
    auto num = 10000*d1 + 1000*d2 + 100*d3 + 10*d4 + d5;
    if (A <= dsum && dsum <= B && num <= N) {
      res += num;
    }
  }

  return res;
} unittest {
  assert(solve("100 4 16") == 4554, "1");
  assert(solve("10 1 2") == 13, "2");
  assert(solve("20 2 5") == 84, "3");
}