import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    }
} import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    }
} Main public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    } main {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int res = 0; res 0 for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        } {
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        } int sum = 0; sum 0 for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            } char c String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i {
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            } {
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            } sum += Character.getNumericValue(c) sum Character.getNumericValue(c) Character.getNumericValue Character c if(sum > b) break; sum > b sum b break; if(a <= sum && b >= sum) res+=i; a <= sum && b >= sum a <= sum a sum b >= sum b sum res+=i res i System.out.println(res) System.out.println System.out System System.out res scan.close() scan.close scan String[] args args public class Main{

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    }
} public class Main{

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    }
} Main
import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();

        int res = 0;

        for(int i=1; i<=n; i++){
            int sum = 0;
            for(char c : String.valueOf(i).toCharArray()){
                sum += Character.getNumericValue(c);
                if(sum > b) break;
            }
            if(a <= sum && b >= sum) res+=i;
            
        }
        System.out.println(res);
        scan.close();
        
    }
}