import java.util.Scanner;

class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        final int A = sc.nextInt();
        final int B = sc.nextInt();
        int total = 0;

        for ( int i = 1; i <= N; i++ ){
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        }
        System.out.println(total);
    }
    private static int digits_sum(int n){
        int sum = 0;
        for(char c: Integer.toString(n).toCharArray()){
            
            sum  += Character.getNumericValue(c);
        }
        return sum;
    }
} import java.util.Scanner; Scanner java.util class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        final int A = sc.nextInt();
        final int B = sc.nextInt();
        int total = 0;

        for ( int i = 1; i <= N; i++ ){
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        }
        System.out.println(total);
    }
    private static int digits_sum(int n){
        int sum = 0;
        for(char c: Integer.toString(n).toCharArray()){
            
            sum  += Character.getNumericValue(c);
        }
        return sum;
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        final int A = sc.nextInt();
        final int B = sc.nextInt();
        int total = 0;

        for ( int i = 1; i <= N; i++ ){
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        }
        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        final int A = sc.nextInt();
        final int B = sc.nextInt();
        int total = 0;

        for ( int i = 1; i <= N; i++ ){
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        }
        System.out.println(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc final int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc final int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int total = 0; total 0 for ( int i = 1; i <= N; i++ ){
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        } {
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        } int n = digits_sum(i); n digits_sum(i) digits_sum i if ( n >= A && n <= B ){
                total += i;
            } n >= A && n <= B n >= A n A n <= B n B {
                total += i;
            } total += i total i System.out.println(total) System.out.println System.out System System.out total String[] args args private static int digits_sum(int n){
        int sum = 0;
        for(char c: Integer.toString(n).toCharArray()){
            
            sum  += Character.getNumericValue(c);
        }
        return sum;
    } digits_sum {
        int sum = 0;
        for(char c: Integer.toString(n).toCharArray()){
            
            sum  += Character.getNumericValue(c);
        }
        return sum;
    } int sum = 0; sum 0 for(char c: Integer.toString(n).toCharArray()){
            
            sum  += Character.getNumericValue(c);
        } char c Integer.toString(n).toCharArray() Integer.toString(n).toCharArray Integer.toString(n) Integer.toString Integer n {
            
            sum  += Character.getNumericValue(c);
        } {
            
            sum  += Character.getNumericValue(c);
        } sum  += Character.getNumericValue(c) sum Character.getNumericValue(c) Character.getNumericValue Character c return sum; sum int n n
import java.util.Scanner;

class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        final int A = sc.nextInt();
        final int B = sc.nextInt();
        int total = 0;

        for ( int i = 1; i <= N; i++ ){
            int n = digits_sum(i);
            if ( n >= A && n <= B ){
                total += i;
            }
        }
        System.out.println(total);
    }
    private static int digits_sum(int n){
        int sum = 0;
        for(char c: Integer.toString(n).toCharArray()){
            
            sum  += Character.getNumericValue(c);
        }
        return sum;
    }
}