import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	}
} Main public static void main(String[] args) {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	} main {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	} try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		} {
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) int N = Integer.parseInt(scan.next()); N Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int a = Integer.parseInt(scan.next()); a Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int b = Integer.parseInt(scan.next()); b Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int sum = 0; sum 0 for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			} {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			} int tmpSum = 0; tmpSum 0 int num = i; num i while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				} num != 0 num 0 {
					tmpSum += num %10;
					num /= 10;
				} tmpSum += num %10 tmpSum num %10 num 10 num /= 10 num 10 if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				} tmpSum >= a && tmpSum <= b tmpSum >= a tmpSum a tmpSum <= b tmpSum 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) {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	}
} public class Main{

	public static void main(String[] args) {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	}
} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		try(Scanner scan = new Scanner(System.in);){
			int N = Integer.parseInt(scan.next());
			int a = Integer.parseInt(scan.next());
			int b = Integer.parseInt(scan.next());
			int sum = 0;
			for(int i=1; i<=N; i++) {
				int tmpSum = 0;
				int num = i;
				while(num != 0) {
					tmpSum += num %10;
					num /= 10;
				}
				if(tmpSum >= a && tmpSum <= b) {
					sum += i;
				}
			}
          System.out.println(sum);
		}
	}
}