import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    }

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner 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();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    }

} 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();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    } 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 List<Integer> list = new ArrayList<>(); list new ArrayList<>() int result = 0; result 0 for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        } {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i int sum = 0; sum 0 for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            } int j = 0; int j = 0; j 0 j < str.length() j str.length() str.length str j++ j++ j {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            } {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            } String s = str.substring(j, j+1); s str.substring(j, j+1) str.substring str j j+1 j 1 int x = Integer.parseInt(s); x Integer.parseInt(s) Integer.parseInt Integer s sum += x sum x if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            } A <= sum && sum <= B A <= sum A sum sum <= B sum B {
                //System.out.println("sum：" + sum);
                result += i;
            } result += i result i System.out.println(result) System.out.println System.out System System.out result 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();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    }

} 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();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    }

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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();

        List<Integer> list = new ArrayList<>();

        int result = 0;
        for (int i = 1; i <= N; i++) {
            String str = String.valueOf(i);
            //System.out.println("str：" + str);
            int sum = 0;

            //各桁に分ける
            for (int j = 0; j < str.length(); j++) {
                String s = str.substring(j, j+1);
                //System.out.println("s：" + s);
                int x = Integer.parseInt(s);
                //各桁の和
                sum += x;
            }

            //各桁の和が条件に合うか判定し合うものは足す
            if (A <= sum && sum <= B) {
                //System.out.println("sum：" + sum);
                result += i;
            }

        }
        System.out.println(result);
    }

}