import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    } 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 sc.close() sc.close sc int tmpSum = 0; tmpSum 0 int sum = 0; sum 0 for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        } int i=0; int i=0; i 0 i<=n i n i++ i++ i {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        } {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        } String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            } int j=0; int j=0; j 0 j<s.length() j s.length() s.length s j++ j++ j {
                tmpSum += Character.getNumericValue(s.charAt(j));
            } {
                tmpSum += Character.getNumericValue(s.charAt(j));
            } tmpSum += Character.getNumericValue(s.charAt(j)) tmpSum Character.getNumericValue(s.charAt(j)) Character.getNumericValue Character s.charAt(j) s.charAt s j if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            } tmpSum >= a && tmpSum <= b tmpSum >= a tmpSum a tmpSum <= b tmpSum b {
                sum += i;
            } sum += i sum i tmpSum = 0 tmpSum 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 sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int tmpSum = 0;
        int sum = 0;
        for(int i=0; i<=n; i++) {
            String s = Integer.toString(i);
            for(int j=0; j<s.length(); j++) {
                tmpSum += Character.getNumericValue(s.charAt(j));
            }
            if(tmpSum >= a && tmpSum <= b) {
                sum += i;
            }
            tmpSum = 0;
        }
        System.out.println(sum);
    }
}
