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 total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	} 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 total = 0; total 0 for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		} {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		} String is = String.valueOf(i); is String.valueOf(i) String.valueOf String i int sum = 0; sum 0 int k = 0; k 0 for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			} int j = 1; int j = 1; j 1 j <= is.length() j is.length() is.length is j++ j++ j {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			} {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			} k = (int)(i / (int)Math.pow(10, j - 1)) % 10 k (int)(i / (int)Math.pow(10, j - 1)) % 10 (int)(i / (int)Math.pow(10, j - 1)) i (int)Math.pow(10, j - 1) Math.pow Math 10 j - 1 j 1 10 sum += k sum k if(A <= sum && sum <= B) {
				total += i;
			} A <= sum && sum <= B A <= sum A sum sum <= B sum B {
				total += i;
			} total += i total i System.out.println(total) System.out.println System.out System System.out total 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 total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 total = 0;
		
		for(int i = 1; i <= N; i++) {
			String is = String.valueOf(i);
			int sum = 0;
			int k = 0;
			for(int j = 1; j <= is.length(); j++) {
				k = (int)(i / (int)Math.pow(10, j - 1)) % 10;
				sum += k;
			}
			if(A <= sum && sum <= B) {
				total += i;
			}
		}
		System.out.println(total);
	}
}
