import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int ans = 0;
    for (int i = 1; i < n+1; i++){
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int ans = 0;
    for (int i = 1; i < n+1; i++){
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int ans = 0;
    for (int i = 1; i < n+1; i++){
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int ans = 0;
    for (int i = 1; i < n+1; i++){
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i = 1; i < n+1; i++){
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    } int i = 1; int i = 1; i 1 i < n+1 i n+1 n 1 i++ i++ i {
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    } {
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    } int x = i; x i int temp = 0; temp 0 while (x > 0){
        temp += x%10;
        x
         /= 10;
      } x > 0 x 0 {
        temp += x%10;
        x
         /= 10;
      } temp += x%10 temp x%10 x 10 x
         /= 10 x 10 if (a <= temp && temp <= b){ans += i;} a <= temp && temp <= b a <= temp a temp temp <= b temp b {ans += i;} ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int ans = 0;
    for (int i = 1; i < n+1; i++){
      int x = i;
      int temp = 0;
      while (x > 0){
        temp += x%10;
        x
         /= 10;
      }
      if (a <= temp && temp <= b){ans += i;}
    }
    System.out.println(ans);
  }
}
