import java.util.Scanner;

class Main{
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		int ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
	
	public static int splitN(int n) {
		int sum = 0;
		String str = Integer.toString(n);
		String[] S = str.split("");
		
		for(int i = 0; i < S.length; i++) {
			sum += Integer.parseInt(S[i]); 
		}
		return sum;
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		int ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
	
	public static int splitN(int n) {
		int sum = 0;
		String str = Integer.toString(n);
		String[] S = str.split("");
		
		for(int i = 0; i < S.length; i++) {
			sum += Integer.parseInt(S[i]); 
		}
		return sum;
	}
} Main public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		int ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		int ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	} 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 sc.close() sc.close sc int ans = 0; ans 0 for(int i = 1; i <= N; i++) {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		} {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		} if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			} splitN(i) >= A && splitN(i) <= B splitN(i) >= A splitN(i) splitN i A splitN(i) <= B splitN(i) splitN i B {
				ans += i;
			} ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String arg[] arg public static int splitN(int n) {
		int sum = 0;
		String str = Integer.toString(n);
		String[] S = str.split("");
		
		for(int i = 0; i < S.length; i++) {
			sum += Integer.parseInt(S[i]); 
		}
		return sum;
	} splitN {
		int sum = 0;
		String str = Integer.toString(n);
		String[] S = str.split("");
		
		for(int i = 0; i < S.length; i++) {
			sum += Integer.parseInt(S[i]); 
		}
		return sum;
	} int sum = 0; sum 0 String str = Integer.toString(n); str Integer.toString(n) Integer.toString Integer n String[] S = str.split(""); S str.split("") str.split str "" for(int i = 0; i < S.length; i++) {
			sum += Integer.parseInt(S[i]); 
		} int i = 0; int i = 0; i 0 i < S.length i S.length S S.length i++ i++ i {
			sum += Integer.parseInt(S[i]); 
		} {
			sum += Integer.parseInt(S[i]); 
		} sum += Integer.parseInt(S[i]) sum Integer.parseInt(S[i]) Integer.parseInt Integer S[i] S i return sum; sum int n n
import java.util.Scanner;

class Main{
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		int ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(splitN(i) >= A && splitN(i) <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
	
	public static int splitN(int n) {
		int sum = 0;
		String str = Integer.toString(n);
		String[] S = str.split("");
		
		for(int i = 0; i < S.length; i++) {
			sum += Integer.parseInt(S[i]); 
		}
		return sum;
	}
}