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 tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = 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 n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
} 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 tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		}
		System.out.println(sum);
	} 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 tmp = 0; tmp 0 int tmpsum = 0; tmpsum 0 int sum = 0; sum 0 for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		} {
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		} tmpsum = 0 tmpsum 0 tmp = i tmp i for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			} int t = 0; int t = 0; t 0 t <= 4 t 4 t++ t++ t {
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			} {
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			} tmpsum = tmpsum + (tmp % 10) tmpsum tmpsum + (tmp % 10) tmpsum (tmp % 10) tmp 10 tmp = tmp/10 tmp tmp/10 tmp 10 if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			} (tmpsum >= a) && (tmpsum <= b) (tmpsum >= a) tmpsum a (tmpsum <= b) tmpsum b {
				sum = sum + i;
			} sum = sum + i sum 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 n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
} 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 tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = 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 n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int tmp = 0;
		int tmpsum = 0;
		int sum = 0;
		for(int i = 1; i <= n; i++){
			tmpsum = 0;
			tmp = i;
			for(int t = 0; t <= 4; t++){
				tmpsum = tmpsum + (tmp % 10);
				tmp = tmp/10;
			}
			if((tmpsum >= a) && (tmpsum <= b)){
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
}
