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