import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    }

    private static int gettotal(int i) {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    }
}
 import java.lang.reflect.Array; Array java.lang.reflect 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 scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    }

    private static int gettotal(int i) {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    }
} Main public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    } main {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan List<Integer> totalList = new ArrayList<Integer>(); totalList new ArrayList<Integer>() for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        } int i=0; int i=0; i 0 i<= n i n i++ i++ i {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        } {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        } int sum = gettotal(i); sum gettotal(i) gettotal i if (a <= sum && b >= sum) {
                totalList.add(i);
            } a <= sum && b >= sum a <= sum a sum b >= sum b sum {
                totalList.add(i);
            } totalList.add(i) totalList.add totalList i int res = 0; res 0 for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        } int i=0; int i=0; i 0 i < totalList.size() i totalList.size() totalList.size totalList i++ i++ i {
            res = res + totalList.get(i);
        } {
            res = res + totalList.get(i);
        } res = res + totalList.get(i) res res + totalList.get(i) res totalList.get(i) totalList.get totalList i System.out.print(res) System.out.print System.out System System.out res String[] args args private static int gettotal(int i) {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    } gettotal {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    } int sum = 0; sum 0 while(i !=0) {
            sum += i % 10;
            i /= 10;
        } i !=0 i 0 {
            sum += i % 10;
            i /= 10;
        } sum += i % 10 sum i % 10 i 10 i /= 10 i 10 return sum; sum int i i public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    }

    private static int gettotal(int i) {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    }
} public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    }

    private static int gettotal(int i) {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    }
} Main
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        List<Integer> totalList = new ArrayList<Integer>();
        for(int i=0; i<= n; i++) {
            int sum = gettotal(i);

            if (a <= sum && b >= sum) {
                totalList.add(i);
            }
        }

        int res = 0;
        for (int i=0; i < totalList.size(); i++) {
            res = res + totalList.get(i);
        }
        System.out.print(res);
    }

    private static int gettotal(int i) {
        int sum = 0;
        while(i !=0) {
            sum += i % 10;
            i /= 10;
        }
        return sum;
    }
}

