import std.functional,
       std.algorithm,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void main() {
  int[] NAB = readln.chomp.split.to!(int[]);
  int N = NAB[0],
      A = NAB[1],
      B = NAB[2];
  int ans;

  foreach (i; 1..(N+1)) {
    int t = i.to!(string).split("").to!(int[]).sum;
    if (A <= t && t <= B) {
      ans += i;
    }
  }

  writeln(ans);
}
