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 count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} 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 count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} 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 count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();

		int count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	} 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 count = 0; count 0 for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		} {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		} int[] sum = new int[5]; sum new int[5] 5 sum[0] = i/10000 sum[0] sum 0 i/10000 i 10000 sum[1] = (i-sum[0]*10000)/1000 sum[1] sum 1 (i-sum[0]*10000)/1000 (i-sum[0]*10000) i sum[0]*10000 sum[0] sum 0 10000 1000 sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100 sum[2] sum 2 (i-(sum[0]*10000) - (sum[1]*1000))/100 (i-(sum[0]*10000) - (sum[1]*1000)) i-(sum[0]*10000) - (sum[1]*1000) i (sum[0]*10000) sum[0] sum 0 10000 (sum[1]*1000) sum[1] sum 1 1000 100 sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10 sum[3] sum 3 (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10 (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100) (sum[1]*1000) i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 i (sum[0]*10000) sum[0] sum 0 10000 (sum[1]*1000) sum[1] sum 1 1000 sum[2]*100 sum[2] sum 2 100 10 sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10) sum[4] sum 4 (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10) sum[2]*100 (sum[1]*1000) i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10 i (sum[0]*10000) sum[0] sum 0 10000 (sum[1]*1000) sum[1] sum 1 1000 sum[2]*100 sum[2] sum 2 100 sum[3]*10 sum[3] sum 3 10 int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4]; s sum[0] + sum[1] + sum[2] + sum[3] + sum[4] sum[3] sum[2] sum[0] + sum[1] + sum[2] + sum[3] + sum[4] sum[0] sum 0 sum[1] sum 1 sum[2] sum 2 sum[3] sum 3 sum[4] sum 4 if(s >= A && s <= B) {
				count+= i;
			} s >= A && s <= B s >= A s A s <= B s B {
				count+= i;
			} count+= i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public static void print(Object o) {
		System.out.print(o);
	} print {
		System.out.print(o);
	} System.out.print(o) System.out.print System.out System System.out o Object o o public static void println(Object o) {
		System.out.println(o);
	} println {
		System.out.println(o);
	} System.out.println(o) System.out.println System.out System System.out o Object o o 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 count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} 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 count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} 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 count = 0;
		for(int i=1; i<=N; i++) {
			int[] sum = new int[5];
			sum[0] = i/10000;
			sum[1] = (i-sum[0]*10000)/1000;
			sum[2] = (i-(sum[0]*10000) - (sum[1]*1000))/100;
			sum[3] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100)/10;
			sum[4] = (i-(sum[0]*10000) - (sum[1]*1000) - sum[2]*100 - sum[3]*10);

			int s = sum[0] + sum[1] + sum[2] + sum[3] + sum[4];
			//println(sum[0]+","+sum[1]+","+sum[2]+","+sum[3]+s);

			if(s >= A && s <= B) {
				count+= i;
			}
		}

		System.out.println(count);
	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
}