import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	}
	
	public static int method(int n){
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	}
	
	public static int method(int n){
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int sum = 0; sum 0 int num = 0; num 0 for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		} {
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		} num = method(i) num method(i) method i if(a <= num && num <= b){
				sum += i;
			} a <= num && num <= b a <= num a num num <= b num b {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int method(int n){
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	} method {
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	} int sum = 0; sum 0 while(n > 0){
			sum += n % 10;
			n /= 10;
		} n > 0 n 0 {
			sum += n % 10;
			n /= 10;
		} sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	}
	
	public static int method(int n){
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	}
	
	public static int method(int n){
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}
} Main
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int sum = 0;
		int num = 0;
		for(int i=1; i<=n; i++){
			num = method(i);
			if(a <= num && num <= b){
				sum += i;
			}
		}
		System.out.println(sum);
	}
	
	public static int method(int n){
		int sum = 0;
		while(n > 0){
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}
}
