import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    } main {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int limit = scanner.nextInt(); limit scanner.nextInt() scanner.nextInt scanner int lower = scanner.nextInt(); lower scanner.nextInt() scanner.nextInt scanner int upper = scanner.nextInt(); upper scanner.nextInt() scanner.nextInt scanner String num = new String(); num new String() int tmp = 0; tmp 0 int sum = 0; sum 0 for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        } int i=0; int i=0; i 0 i<=limit i limit i++ i++ i {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        } {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        } num = Integer.toString(i) num Integer.toString(i) Integer.toString Integer i for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            } int j=0; int j=0; j 0 j<num.length() j num.length() num.length num j++ j++ j {
                tmp += Character.getNumericValue(num.charAt(j));
            } {
                tmp += Character.getNumericValue(num.charAt(j));
            } tmp += Character.getNumericValue(num.charAt(j)) tmp Character.getNumericValue(num.charAt(j)) Character.getNumericValue Character num.charAt(j) num.charAt num j if(tmp >= lower && tmp <= upper) {
                sum += i;
            } tmp >= lower && tmp <= upper tmp >= lower tmp lower tmp <= upper tmp upper {
                sum += i;
            } sum += i sum i tmp = 0 tmp 0 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();
        int lower = scanner.nextInt();
        int upper = scanner.nextInt();
        String num = new String();
        int tmp = 0;
        int sum = 0;

        for(int i=0; i<=limit; i++) {
            num = Integer.toString(i);
            for(int j=0; j<num.length(); j++) {
                tmp += Character.getNumericValue(num.charAt(j));
            }
            if(tmp >= lower && tmp <= upper) {
                sum += i;
            }
            tmp = 0;
        }
        System.out.println(sum);
    }
}
