
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();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	}
} 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();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	}
} 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();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	} main {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	} 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 int sum = 0; sum 0 for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		} {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i int sum1 = 0; sum1 0 for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			} int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			} {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			} sum1 += Integer.parseInt(s.substring(j, j + 1)) sum1 Integer.parseInt(s.substring(j, j + 1)) Integer.parseInt Integer s.substring(j, j + 1) s.substring s j j + 1 j 1 if (sum1 >= a && sum1 <= b) {
				sum += i;
			} sum1 >= a && sum1 <= b sum1 >= a sum1 a sum1 <= b sum1 b {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum 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();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	}
} 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();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	}
} 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();
		
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			String s = String.valueOf(i);
			int sum1 = 0;
			for (int j = 0; j < s.length(); j++) {
				sum1 += Integer.parseInt(s.substring(j, j + 1));
			}
			if (sum1 >= a && sum1 <= b) {
				sum += i;
			}
		}
		
		System.out.println(sum);
	}
}
