import java.util.*;

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

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    }

} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    }

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

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner long count = 0; count 0 for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        } {
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        } long instance = 0; instance 0 for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            } int j=0; int j=0; j 0 j<Integer.toString(i).length() j Integer.toString(i).length() Integer.toString(i).length Integer.toString(i) Integer.toString Integer i j++ j++ j {
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            } {
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            } instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j))) instance Integer.parseInt(Character.toString(Integer.toString(i).charAt(j))) Integer.parseInt Integer Character.toString(Integer.toString(i).charAt(j)) Character.toString Character Integer.toString(i).charAt(j) Integer.toString(i).charAt Integer.toString(i) Integer.toString Integer i j if (a<=instance&&instance<=b){
                count+=i;
            } a<=instance&&instance<=b a<=instance a instance instance<=b instance b {
                count+=i;
            } count+=i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    }

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

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    }

} Main
import java.util.*;

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

        long count = 0;

        for (int i=1;i<=n;i++){
            long instance = 0;
            for (int j=0;j<Integer.toString(i).length();j++){
                instance += Integer.parseInt(Character.toString(Integer.toString(i).charAt(j)));
            }
            if (a<=instance&&instance<=b){
                count+=i;
            }
        }
        System.out.println(count);
    }

}