import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	} 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 count = 0; count 0 for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		} {
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		} int sum = 0; sum 0 for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			} int j = 0; int j = 0; j 0 j < String.valueOf(i).length() j String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i j++ j++ j {
				sum += String.valueOf(i).charAt(j)-'0';
			} {
				sum += String.valueOf(i).charAt(j)-'0';
			} sum += String.valueOf(i).charAt(j)-'0' sum String.valueOf(i).charAt(j)-'0' String.valueOf(i).charAt(j) String.valueOf(i).charAt String.valueOf(i) String.valueOf String i j '0' if(a <= sum && sum <= b)count += i; a <= sum && sum <= b a <= sum a sum sum <= b sum b count += i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		
		for(int i = 1; i <= n; i++){
			int sum = 0;
			for(int j = 0; j < String.valueOf(i).length(); j++){
				sum += String.valueOf(i).charAt(j)-'0';
			}
			if(a <= sum && sum <= b)count += i;
		}
		System.out.println(count);
	}
}