import java.util.ArrayList;
import java.util.Scanner;
public class Main {
	public static Integer sum(ArrayList<Integer> M) {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	}

	public static void main(String[] args) {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static Integer sum(ArrayList<Integer> M) {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	}

	public static void main(String[] args) {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	}
} Main public static Integer sum(ArrayList<Integer> M) {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	} sum {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	} int sum = 0; sum 0 for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		} int i = 0; int i = 0; i 0 i < M.size() i M.size() M.size M i++ i++ i {
			sum += (int)M.get(i);
		} {
			sum += (int)M.get(i);
		} sum += (int)M.get(i) sum (int)M.get(i) M.get M i return(sum); (sum) ArrayList<Integer> M M public static void main(String[] args) {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	} main {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	} int A A B B N; N int s = 0; s 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) N = scan.nextInt() N scan.nextInt() scan.nextInt scan A = scan.nextInt() A scan.nextInt() scan.nextInt scan B = scan.nextInt() B scan.nextInt() scan.nextInt scan ArrayList<Integer> M = new ArrayList<Integer>(); M new ArrayList<Integer>() for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		} {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		} String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			} int j = 0; int j = 0; j 0 j < str.length() j str.length() str.length str j++ j++ j {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			} {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			} char ch = str.charAt(j); ch str.charAt(j) str.charAt str j int k = Character.getNumericValue(ch); k Character.getNumericValue(ch) Character.getNumericValue Character ch M.add(k) M.add M k if(A <= sum(M) && sum(M) <= B) {
				s += i;
			} A <= sum(M) && sum(M) <= B A <= sum(M) A sum(M) sum M sum(M) <= B sum(M) sum M B {
				s += i;
			} s += i s i M.clear() M.clear M System.out.println(s) System.out.println System.out System System.out s scan.close() scan.close scan String[] args args public class Main {
	public static Integer sum(ArrayList<Integer> M) {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	}

	public static void main(String[] args) {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	}
} public class Main {
	public static Integer sum(ArrayList<Integer> M) {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	}

	public static void main(String[] args) {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
	public static Integer sum(ArrayList<Integer> M) {
		int sum = 0;
		for(int i = 0; i < M.size(); i++) {
			sum += (int)M.get(i);
		}
		return(sum);
	}

	public static void main(String[] args) {
		int A,B,N;
		int s = 0;
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		A = scan.nextInt();
		B = scan.nextInt();
		ArrayList<Integer> M = new ArrayList<Integer>();

		for(int i = 1; i <= N; i++) {
			String str = String.valueOf(i);
			for(int j = 0; j < str.length(); j++) {
				char ch = str.charAt(j);
				int k = Character.getNumericValue(ch);
				M.add(k);
			}
			if(A <= sum(M) && sum(M) <= B) {
				s += i;
			}
			M.clear();
		}
		System.out.println(s);
		scan.close();
	}
}
