import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class SomeSums {

		private int n;
		private int a;
		private int b;
		private Scanner scanner;
		private int output;

		public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		}

		public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		}

		public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class SomeSums {

		private int n;
		private int a;
		private int b;
		private Scanner scanner;
		private int output;

		public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		}

		public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		}

		public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}
	}
} Main public static void main(String[] args) {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	} main {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	} SomeSums solver = new SomeSums(); solver new SomeSums() solver.readInput() solver.readInput solver solver.solve() solver.solve solver solver.writeOutput() solver.writeOutput solver String[] args args static class SomeSums {

		private int n;
		private int a;
		private int b;
		private Scanner scanner;
		private int output;

		public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		}

		public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		}

		public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}
	} SomeSums private int n; n private int a; a private int b; b private Scanner scanner; scanner private int output; output public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		} SomeSums {
			scanner = new Scanner(System.in);
			output = 0;
		} scanner = new Scanner(System.in) scanner new Scanner(System.in) output = 0 output 0 public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		} readInput {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		} n = scanner.nextInt() n scanner.nextInt() scanner.nextInt scanner a = scanner.nextInt() a scanner.nextInt() scanner.nextInt scanner b = scanner.nextInt() b scanner.nextInt() scanner.nextInt scanner public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		} solve {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		} int t t sum; sum for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			} {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			} t = i t i sum = 0 sum 0 while(t!=0) {
					sum += t%10;
					t /= 10;
				} t!=0 t 0 {
					sum += t%10;
					t /= 10;
				} sum += t%10 sum t%10 t 10 t /= 10 t 10 if(sum>=a && sum <= b) {
					output += i;
				} sum>=a && sum <= b sum>=a sum a sum <= b sum b {
					output += i;
				} output += i output i public void writeOutput() {
			System.out.println(output);
		} writeOutput {
			System.out.println(output);
		} System.out.println(output) System.out.println System.out System System.out output public class Main {

	public static void main(String[] args) {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class SomeSums {

		private int n;
		private int a;
		private int b;
		private Scanner scanner;
		private int output;

		public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		}

		public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		}

		public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}
	}
} public class Main {

	public static void main(String[] args) {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class SomeSums {

		private int n;
		private int a;
		private int b;
		private Scanner scanner;
		private int output;

		public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		}

		public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		}

		public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		SomeSums solver = new SomeSums();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class SomeSums {

		private int n;
		private int a;
		private int b;
		private Scanner scanner;
		private int output;

		public SomeSums() {
			scanner = new Scanner(System.in);
			output = 0;
		}

		public void readInput() {
			n = scanner.nextInt();
			a = scanner.nextInt();
			b = scanner.nextInt();
		}

		public void solve() {
			int t,sum;
			for(int i=1; i<=n;i++) {
				t = i;
				sum = 0;
				while(t!=0) {
					sum += t%10;
					t /= 10;
				}
				if(sum>=a && sum <= b) {
					output += i;
				}
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}
	}
}
