import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan scan.close() scan.close scan int sumResult = 0; sumResult 0 for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		} int i=1; int i=1; i 1 i<=n i n ++i ++i i {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		} {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		} int sumPerKeta = 0; sumPerKeta 0 String formated = String.format("%04d", i); formated String.format("%04d", i) String.format String "%04d" i for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			} int j=0; int j=0; j 0 j<= 3 j 3 ++j ++j j {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			} {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			} char numChar = formated.charAt(j); numChar formated.charAt(j) formated.charAt formated j int num = Character.getNumericValue(numChar); num Character.getNumericValue(numChar) Character.getNumericValue Character numChar sumPerKeta += num sumPerKeta num if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			} a <= sumPerKeta && sumPerKeta <= b a <= sumPerKeta a sumPerKeta sumPerKeta <= b sumPerKeta b {
				sumResult += i;
			} sumResult += i sumResult i System.out.println(sumResult) System.out.println System.out System System.out sumResult String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();
		int sumResult = 0;
		for(int i=1; i<=n; ++i) {
			int sumPerKeta = 0;
			String formated = String.format("%04d", i);
			for(int j=0; j<= 3; ++j) {
				char numChar = formated.charAt(j);
				int num = Character.getNumericValue(numChar);
				sumPerKeta += num;
			}
			if(a <= sumPerKeta && sumPerKeta <= b) {
				sumResult += i;
			}
		}
		System.out.println(sumResult);
	}

}
