import java.util.Scanner;

public class Main {

	
	
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	}
	
	static int checkSum(int n) {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	}

} import java.util.Scanner; Scanner java.util public class Main {

	
	
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	}
	
	static int checkSum(int n) {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	} main {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	} int n n a a b; b Scanner scan = new Scanner(System.in); scan new Scanner(System.in) n = scan.nextInt() n scan.nextInt() scan.nextInt scan a = scan.nextInt() a scan.nextInt() scan.nextInt scan b = scan.nextInt() b scan.nextInt() scan.nextInt scan int total = 0; total 0 for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n ++i ++i i {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		} {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		} int sum = checkSum(i); sum checkSum(i) checkSum i if(sum >= a && sum <= b) {
				total += i;
			} sum >= a && sum <= b sum >= a sum a 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 static int checkSum(int n) {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	} checkSum {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	} int sum = 0; sum 0 while(n > 0) {

			sum += n % 10;
			n /= 10;

		} n > 0 n 0 {

			sum += n % 10;
			n /= 10;

		} sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public class Main {

	
	
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	}
	
	static int checkSum(int n) {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	}

} public class Main {

	
	
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	}
	
	static int checkSum(int n) {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	}

} Main
import java.util.Scanner;

public class Main {

	
	
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	
		int n, a, b;
		
		Scanner scan = new Scanner(System.in);
		
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		int total = 0;
		for(int i = 1; i <= n; ++i) {
			int sum = checkSum(i);
			if(sum >= a && sum <= b) {
				total += i;
			}
		}
		
		System.out.println(total);


	}
	
	static int checkSum(int n) {
		int sum = 0;
		while(n > 0) {

			sum += n % 10;
			n /= 10;

		}
		
		return sum;
	}

}
