import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i=0;i<=N;i++){
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        }
        System.out.println(count);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i=0;i<=N;i++){
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        }
        System.out.println(count);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i=0;i<=N;i++){
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i=0;i<=N;i++){
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        }
        System.out.println(count);
    } 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 count = 0; count 0 for(int i=0;i<=N;i++){
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        } int i=0; int i=0; i 0 i<=N i N i++ i++ i {
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        } {
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        } int num=i; num i int sum=0; sum 0 while(num!=0){
                sum+=num%10;
                num/=10;
            } num!=0 num 0 {
                sum+=num%10;
                num/=10;
            } sum+=num%10 sum num%10 num 10 num/=10 num 10 if(A<=sum && sum<=B){count+=i;} A<=sum && sum<=B A<=sum A sum sum<=B sum B {count+=i;} count+=i count i System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i=0;i<=N;i++){
            int num=i;
            int sum=0;
            while(num!=0){
                sum+=num%10;
                num/=10;
            }
            if(A<=sum && sum<=B){count+=i;}
        }
        System.out.println(count);
    }
}