	import java.util.*;
	
	
	
	public class Main {
	
		public static void main(String[] args) {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		}
		
	} import java.util.*; util.* java public class Main {
	
		public static void main(String[] args) {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		}
		
	} Main public static void main(String[] args) {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		} main {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int A= sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int res = 0; res 0 for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			} {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			} int sum = 0; sum 0 for (int n =i;n>0;n/=10) {
					sum += n%10;
				} int n =i; int n =i; n i n>0 n 0 n/=10 n/=10 n 10 {
					sum += n%10;
				} {
					sum += n%10;
				} sum += n%10 sum n%10 n 10 if(A<=sum && sum<=B){
					res = res + i;
					} A<=sum && sum<=B A<=sum A sum sum<=B sum B {
					res = res + i;
					} res = res + i res res + i res i System.out.println(res) System.out.println System.out System System.out res sc.close() sc.close sc String[] args args public class Main {
	
		public static void main(String[] args) {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		}
		
	} public class Main {
	
		public static void main(String[] args) {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		}
		
	} Main
	import java.util.*;
	
	
	
	public class Main {
	
		public static void main(String[] args) {
		
			Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int A= sc.nextInt();
			int B = sc.nextInt();
			int res = 0;
			
			for (int i=1;i<=N;i++) {
				int sum = 0;
				for (int n =i;n>0;n/=10) {
					sum += n%10;
				}
			
				if(A<=sum && sum<=B){
					res = res + i;
					}
			}
			System.out.println(res);
			
			sc.close();
		}
		
	}
