import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    }
    
    static int Digitsum(int a){
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    }
    
    static int Digitsum(int a){
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    }
} Main public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    } 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 int tmp = 0 tmp 0 sum = 0; sum 0 for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        } int i=0; int i=0; i 0 i<=n i n i++ i++ i {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        } {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        } tmp = Digitsum(i) tmp Digitsum(i) Digitsum i if(tmp>=a && b>=tmp)
            {
                sum+=i;
            } tmp>=a && b>=tmp tmp>=a tmp a b>=tmp b tmp {
                sum+=i;
            } sum+=i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args static int Digitsum(int a){
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    } Digitsum {
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    } int sum=0; sum 0 while(a>0)
        {
            sum+=a%10;
            a/=10;
        } a>0 a 0 {
            sum+=a%10;
            a/=10;
        } sum+=a%10 sum a%10 a 10 a/=10 a 10 return sum; sum int a a public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    }
    
    static int Digitsum(int a){
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    }
    
    static int Digitsum(int a){
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int tmp = 0,sum = 0;
        for(int i=0;i<=n;i++)
        {
            tmp = Digitsum(i);
            if(tmp>=a && b>=tmp)
            {
                sum+=i;
            }
        }
        System.out.println(sum);
    }
    
    static int Digitsum(int a){
        int sum=0;
        while(a>0)
        {
            sum+=a%10;
            a/=10;
        }
        return sum;
    }
}