import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    }

} Main // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) // 標準入力数値配列用
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputval {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " int[] intarray = new int[strarray.length]; intarray new int[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray public static void main(String[] args) throws Exception {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    } main {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    } int[] intArray = inputval(); intArray inputval() inputval int n = intArray[0]; n intArray[0] intArray 0 int a = intArray[1]; a intArray[1] intArray 1 int b = intArray[2]; b intArray[2] intArray 2 int ans = 0; ans 0 for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        } {
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        } String nStr = String.valueOf(i); nStr String.valueOf(i) String.valueOf String i int num = 0; num 0 for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            } int j=0; int j=0; j 0 j<nStr.length() j nStr.length() nStr.length nStr j++ j++ j {
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            } {
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            } char numPart = nStr.charAt(j); numPart nStr.charAt(j) nStr.charAt nStr j num += Character.getNumericValue(numPart) num Character.getNumericValue(numPart) Character.getNumericValue Character numPart if (num >= a && num <=b){
                ans += i;
            } num >= a && num <=b num >= a num a num <=b num b {
                ans += i;
            } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    }

} public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        int[] intArray = inputval();
        int n = intArray[0];
        int a = intArray[1];
        int b = intArray[2];
        int ans = 0;

        for (int i=1; i<=n; i++){
            String nStr = String.valueOf(i);
            int num = 0;
            for (int j=0; j<nStr.length(); j++){
                char numPart = nStr.charAt(j);
                num += Character.getNumericValue(numPart);
            }
            if (num >= a && num <=b){
                ans += i;
            }
        }

        System.out.println(ans);
    }

}

