import java.util.*;

public class Main {
    public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    }
    
    public static int sumDigits(int n){
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    }
    
    public static int sumDigits(int n){
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    }
} Main public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    } 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 int result = 0; result 0 for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        } {

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        } int sum = sumDigits(i); sum sumDigits(i) sumDigits i if(sum >= A && sum <= B){
                result += i;
            } sum >= A && sum <= B sum >= A sum A sum <= B sum B {
                result += i;
            } result += i result i System.out.println(result) System.out.println System.out System System.out result String[] args args public static int sumDigits(int n){
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    } sumDigits {
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    } int sum = 0; sum 0 while(n != 0){
            sum += n % 10;
            n = n / 10;
        } n != 0 n 0 {
            sum += n % 10;
            n = n / 10;
        } sum += n % 10 sum n % 10 n 10 n = n / 10 n n / 10 n 10 return sum; sum int n n public class Main {
    public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    }
    
    public static int sumDigits(int n){
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    }
} public class Main {
    public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    }
    
    public static int sumDigits(int n){
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        int result = 0;
        
        for(int i = 1; i <= N ; i++){

            int sum = sumDigits(i);
            if(sum >= A && sum <= B){
                result += i;
            }
        }

        System.out.println(result);
    }
    
    public static int sumDigits(int n){
        int sum = 0;
        
        while(n != 0){
            sum += n % 10;
            n = n / 10;
        }
        return sum;
    }
}
