import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int sum = 0; sum 0 int cnt = sc.nextInt(); cnt sc.nextInt() sc.nextInt sc int low = sc.nextInt(); low sc.nextInt() sc.nextInt sc int high = sc.nextInt(); high sc.nextInt() sc.nextInt sc for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= cnt i cnt i++ i++ i {
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        } {
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        } int num = 0; num 0 int p; p String q; q p = String.valueOf(i).length() p String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i q = String.valueOf(i) q String.valueOf(i) String.valueOf String i for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            } int j = 0; int j = 0; j 0 j < p j p j++ j++ j {
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            } {
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            } char ch = q.charAt(j); ch q.charAt(j) q.charAt q j num += Character.getNumericValue(ch) num Character.getNumericValue(ch) Character.getNumericValue Character ch if((num >= low) && (num <= high)){
                sum += i;
            } (num >= low) && (num <= high) (num >= low) num low (num <= high) num high {
                sum += i;
            } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int sum = 0;
        
		// 整数の入力
		int cnt = sc.nextInt();
		int low = sc.nextInt();
		int high = sc.nextInt();
		
        for(int i = 1; i <= cnt; i++){
            int num = 0;
            int p;
            String q;
            p = String.valueOf(i).length();
            q = String.valueOf(i);
            
            for(int j = 0; j < p; j++){
                char ch = q.charAt(j);
                num += Character.getNumericValue(ch);
            }
            
            if((num >= low) && (num <= high)){
                sum += i;
            }
        }
        
        System.out.println(sum);
	}
}