import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    } main {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    } 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 int ans = 0; ans 0 for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        } {
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        } int tmp = i; tmp i int sum = 0; sum 0 while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            } tmp > 0 tmp 0 {
                sum += tmp % 10;
                tmp /= 10;
            } sum += tmp % 10 sum tmp % 10 tmp 10 tmp /= 10 tmp 10 if(sum >= A && sum <= B) ans += i; sum >= A && sum <= B sum >= A sum A sum <= B sum B ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = 0;
        for(int i = 1; i <= N; i++){
            //数字iの各桁の和を算出
            int tmp = i;
            int sum = 0;
            while(tmp > 0){
                sum += tmp % 10;
                tmp /= 10;
            }
          	//数字iの各桁の和がA以上B以下ならば加算
            if(sum >= A && sum <= B) ans += i;
        }
        System.out.println(ans);
    }
}
