import java.util.Scanner;

class Main{
    static Scanner sc=new Scanner(System.in);
    public static void main(String args[]){
        int n,a,b;
        n=sc.nextInt();
        a=sc.nextInt();
        b=sc.nextInt();
        
        int sum=0,ans=0;
        for(int i=0;i<=n;i++){
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        }
        System.out.println(ans);
    }
    

} import java.util.Scanner; Scanner java.util class Main{
    static Scanner sc=new Scanner(System.in);
    public static void main(String args[]){
        int n,a,b;
        n=sc.nextInt();
        a=sc.nextInt();
        b=sc.nextInt();
        
        int sum=0,ans=0;
        for(int i=0;i<=n;i++){
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        }
        System.out.println(ans);
    }
    

} Main static Scanner sc=new Scanner(System.in); sc new Scanner(System.in) public static void main(String args[]){
        int n,a,b;
        n=sc.nextInt();
        a=sc.nextInt();
        b=sc.nextInt();
        
        int sum=0,ans=0;
        for(int i=0;i<=n;i++){
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        }
        System.out.println(ans);
    } main {
        int n,a,b;
        n=sc.nextInt();
        a=sc.nextInt();
        b=sc.nextInt();
        
        int sum=0,ans=0;
        for(int i=0;i<=n;i++){
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        }
        System.out.println(ans);
    } int n n a a b; b n=sc.nextInt() n sc.nextInt() sc.nextInt sc a=sc.nextInt() a sc.nextInt() sc.nextInt sc b=sc.nextInt() b sc.nextInt() sc.nextInt sc int sum=0 sum 0 ans=0; ans 0 for(int i=0;i<=n;i++){
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        } int i=0; int i=0; i 0 i<=n i n i++ i++ i {
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        } {
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        } String x=Integer.toString(i); x Integer.toString(i) Integer.toString Integer i sum=0 sum 0 for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            } int j=0; int j=0; j 0 j<x.length() j x.length() x.length x j++ j++ j {
                sum+=x.charAt(j)-'0';
            } {
                sum+=x.charAt(j)-'0';
            } sum+=x.charAt(j)-'0' sum x.charAt(j)-'0' x.charAt(j) x.charAt x j '0' if(a<=sum&&sum<=b){
                ans+=i;
            } a<=sum&&sum<=b a<=sum a sum sum<=b sum b {
                ans+=i;
            } ans+=i ans i System.out.println(ans) System.out.println System.out System System.out ans String args[] args
import java.util.Scanner;

class Main{
    static Scanner sc=new Scanner(System.in);
    public static void main(String args[]){
        int n,a,b;
        n=sc.nextInt();
        a=sc.nextInt();
        b=sc.nextInt();
        
        int sum=0,ans=0;
        for(int i=0;i<=n;i++){
            String x=Integer.toString(i);
            //System.out.println(x);
            sum=0;
            for(int j=0;j<x.length();j++){
                sum+=x.charAt(j)-'0';
            }
            //System.out.println(">"+sum);
            if(a<=sum&&sum<=b){
                ans+=i;
            }
            
        }
        System.out.println(ans);
    }
    

}