import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    }
} Main public static void main(String[] args) throws Exception {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    } main {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    } int result = 0; result 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        } {
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        } int sum = 0; sum 0 String str = Integer.toString(i); str Integer.toString(i) Integer.toString Integer i String []resultArray = str.split(""); resultArray str.split("") str.split str "" for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            } int j = 0; int j = 0; j 0 j < resultArray.length j resultArray.length resultArray resultArray.length j++ j++ j {
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            } {
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            } int num=Integer.parseInt(resultArray[j]); num Integer.parseInt(resultArray[j]) Integer.parseInt Integer resultArray[j] resultArray j sum += num sum num if(a <= sum && sum <= b){
                result += i;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                result += i;
            } result += i result i System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        int result = 0;
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i=1; i<=n; i++){
            int sum = 0;
            String str = Integer.toString(i);
            String []resultArray = str.split("");
            
            for(int j = 0; j < resultArray.length; j++){
                int num=Integer.parseInt(resultArray[j]);
                sum += num;
            }
            
            if(a <= sum && sum <= b){
                result += i;
            }
            
        }

        System.out.println(result);
        sc.close();
    }
}
