import java.util.Scanner;
     
class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        //sc.nextLine();
        sc.close();
        
        
        //for(int i = 0; i < N; i++) {
        //	String tmp = s[i];
        //	n[i] = Integer.parseInt(tmp);
        //}
        
        System.out.println(sum(S));    
    }
    
    public static int sum(String S) {
        String s[] = S.split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        String[] ss = new String[N+1];
        int a = 0;
        int sum = 0;
        
        
        for(int i = 1; i <= N; i++){
            ss[i] = String.valueOf(i);
        }

        for(int j = 1; j <= N; j++ ){
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        }
		return sum;
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        //sc.nextLine();
        sc.close();
        
        
        //for(int i = 0; i < N; i++) {
        //	String tmp = s[i];
        //	n[i] = Integer.parseInt(tmp);
        //}
        
        System.out.println(sum(S));    
    }
    
    public static int sum(String S) {
        String s[] = S.split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        String[] ss = new String[N+1];
        int a = 0;
        int sum = 0;
        
        
        for(int i = 1; i <= N; i++){
            ss[i] = String.valueOf(i);
        }

        for(int j = 1; j <= N; j++ ){
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        }
		return sum;
    }
} Main public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        //sc.nextLine();
        sc.close();
        
        
        //for(int i = 0; i < N; i++) {
        //	String tmp = s[i];
        //	n[i] = Integer.parseInt(tmp);
        //}
        
        System.out.println(sum(S));    
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        //sc.nextLine();
        sc.close();
        
        
        //for(int i = 0; i < N; i++) {
        //	String tmp = s[i];
        //	n[i] = Integer.parseInt(tmp);
        //}
        
        System.out.println(sum(S));    
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc sc.close() sc.close sc System.out.println(sum(S)) System.out.println System.out System System.out sum(S) sum S String arg[] arg public static int sum(String S) {
        String s[] = S.split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        String[] ss = new String[N+1];
        int a = 0;
        int sum = 0;
        
        
        for(int i = 1; i <= N; i++){
            ss[i] = String.valueOf(i);
        }

        for(int j = 1; j <= N; j++ ){
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        }
		return sum;
    } sum {
        String s[] = S.split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        String[] ss = new String[N+1];
        int a = 0;
        int sum = 0;
        
        
        for(int i = 1; i <= N; i++){
            ss[i] = String.valueOf(i);
        }

        for(int j = 1; j <= N; j++ ){
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        }
		return sum;
    } String s[] = S.split(" "); s S.split(" ") S.split S " " int N = Integer.parseInt(s[0]); N Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 int A = Integer.parseInt(s[1]); A Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 int B = Integer.parseInt(s[2]); B Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 2 String[] ss = new String[N+1]; ss new String[N+1] N+1 N 1 int a = 0; a 0 int sum = 0; sum 0 for(int i = 1; i <= N; i++){
            ss[i] = String.valueOf(i);
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            ss[i] = String.valueOf(i);
        } {
            ss[i] = String.valueOf(i);
        } ss[i] = String.valueOf(i) ss[i] ss i String.valueOf(i) String.valueOf String i for(int j = 1; j <= N; j++ ){
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        } int j = 1; int j = 1; j 1 j <= N j N j++ j++ j {
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        } {
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        } String[] tmp = ss[j].split(""); tmp ss[j].split("") ss[j].split ss[j] ss j "" for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            } int k = 0; int k = 0; k 0 k < tmp.length k tmp.length tmp tmp.length k++ k++ k {
                a += Integer.parseInt(tmp[k]);
            } {
                a += Integer.parseInt(tmp[k]);
            } a += Integer.parseInt(tmp[k]) a Integer.parseInt(tmp[k]) Integer.parseInt Integer tmp[k] tmp k if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            } a >= A && a <= B a >= A a A a <= B a B {
                sum += Integer.parseInt(ss[j]);
            } sum += Integer.parseInt(ss[j]) sum Integer.parseInt(ss[j]) Integer.parseInt Integer ss[j] ss j a = 0 a 0 return sum; sum String S S
import java.util.Scanner;
     
class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        //sc.nextLine();
        sc.close();
        
        
        //for(int i = 0; i < N; i++) {
        //	String tmp = s[i];
        //	n[i] = Integer.parseInt(tmp);
        //}
        
        System.out.println(sum(S));    
    }
    
    public static int sum(String S) {
        String s[] = S.split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        String[] ss = new String[N+1];
        int a = 0;
        int sum = 0;
        
        
        for(int i = 1; i <= N; i++){
            ss[i] = String.valueOf(i);
        }

        for(int j = 1; j <= N; j++ ){
            String[] tmp = ss[j].split("");
            for(int k = 0; k < tmp.length; k++){
                a += Integer.parseInt(tmp[k]);
            }  
            if( a >= A && a <= B){
                sum += Integer.parseInt(ss[j]);
            }
            a = 0;
        }
		return sum;
    }
}