import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    }


    public static int targetInt(int n){
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    }


    public static int targetInt(int n){
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    } main {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] line = sc.nextLine().split(" "); line sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int N = Integer.parseInt(line[0]); N Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int A = Integer.parseInt(line[1]); A Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int B = Integer.parseInt(line[2]); B Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 int ans = 0; ans 0 for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        } int i =1; int i =1; i 1 i <= N i N i++ i++ i {
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        } {
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        } int result = targetInt(i); result targetInt(i) targetInt i if (result >= A && result <= B){
                ans += i;
            } result >= A && result <= B result >= A result A result <= B result B {
                ans += i;
            } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int targetInt(int n){
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    } targetInt {
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    } if(n == 0){
            return 0;
        } n == 0 n 0 {
            return 0;
        } return 0; 0 int result = n % 10; result n % 10 n 10 return result + targetInt(n / 10); result + targetInt(n / 10) result targetInt(n / 10) targetInt n / 10 n 10 int n n public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    }


    public static int targetInt(int n){
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    }


    public static int targetInt(int n){
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] line = sc.nextLine().split(" ");
        
        int N = Integer.parseInt(line[0]);
        int A = Integer.parseInt(line[1]);
        int B = Integer.parseInt(line[2]);
    
        int ans = 0;
        for(int i =1;i <= N;i++){
            int result = targetInt(i);
            if (result >= A && result <= B){
                ans += i;
            }
        }
        
    System.out.println(ans);
    }


    public static int targetInt(int n){
        
        if(n == 0){
            return 0;
        }
        
        int result = n % 10;
    
        return result + targetInt(n / 10);	
    }
}