import java.util.Scanner;

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 sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	}
} import java.util.Scanner; Scanner 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 sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	}
} 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 sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	} main {
		Scanner sc = new Scanner((System.in));
		int N = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	} 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 sum = 0 sum 0 add = 0; add 0 for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		} {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		} if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			} String.valueOf(i).length() == 1 && a <= i && i <= b String.valueOf(i).length() == 1 && a <= i && i <= b String.valueOf(i).length() == 1 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 1 a <= i a i i <= b i b {
				sum += i;
			} sum += i sum i {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			} int j = 0; j 0 add = 0 add 0 while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				} j < String.valueOf(i).length() j String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				} add += Integer.valueOf(String.valueOf(i).substring(j, j + 1)) add Integer.valueOf(String.valueOf(i).substring(j, j + 1)) Integer.valueOf Integer String.valueOf(i).substring(j, j + 1) String.valueOf(i).substring String.valueOf(i) String.valueOf String i j j + 1 j 1 j++ j if (a <= add && add <= b) {
					sum += i;
				} a <= add && add <= b a <= add a add add <= b add b {
					sum += i;
				} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args 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 sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	}
} 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 sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	}
} Main
import java.util.Scanner;

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 sum = 0, add = 0;

		for (int i = 1; i <= N; i++) {
			if (String.valueOf(i).length() == 1 && a <= i && i <= b) {
				sum += i;
			} else {
				int j = 0;
				add = 0;
				while (j < String.valueOf(i).length()) {
					add += Integer.valueOf(String.valueOf(i).substring(j, j + 1));
					j++;
				}
				if (a <= add && add <= b) {
					sum += i;
				}
			}
		}
		
		System.out.println(sum);

		sc.close();
	}
}