import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	}

} Main public static void main(String[] args) {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	} main {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	} int A A B B N N sum; sum boolean isTrue = true; isTrue true sum = 0 sum 0 Scanner input = new Scanner(System.in); input new Scanner(System.in) N = input.nextInt() N input.nextInt() input.nextInt input A = input.nextInt() A input.nextInt() input.nextInt input B = input.nextInt() B input.nextInt() input.nextInt input for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		} {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		} if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			} i<10 && i>=A && i<=B i<10 && i>=A && i<=B i<10 i 10 i>=A i A i<=B i B {
				sum += i;
			} sum += i sum i {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			} int tmp_sum = 0; tmp_sum 0 int tmp = i; tmp i while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				} tmp!=0 tmp 0 {
					tmp_sum += tmp%10;
					tmp/=10;
				} tmp_sum += tmp%10 tmp_sum tmp%10 tmp 10 tmp/=10 tmp 10 if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				} tmp_sum>=A && tmp_sum<=B tmp_sum>=A tmp_sum A tmp_sum<=B tmp_sum B {
					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) {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	}

} public class Main {

	public static void main(String[] args) {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int A,B,N,sum;
		boolean isTrue = true;
		sum = 0;
		Scanner input = new Scanner(System.in);
		N = input.nextInt();
		A = input.nextInt();
		B = input.nextInt();
		
		for(int i = 0; i <= N; i++) {
			if(i<10 && i>=A && i<=B) {
				sum += i;
			}else {
				int tmp_sum = 0;
				int tmp = i;
				while(tmp!=0) {
					tmp_sum += tmp%10;
					tmp/=10;
				}
				if(tmp_sum>=A && tmp_sum<=B) {
					sum += i;
				}
			}
		}		
		System.out.println(sum);
	}

}
