import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		atcode();
	}

	public static void atcode() {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		atcode();
	}

	public static void atcode() {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		atcode();
	} main {
		atcode();
	} atcode() atcode String[] args args public static void atcode() {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	} atcode {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	} String[] info = new Scanner(System.in).nextLine().split(" "); info new Scanner(System.in).nextLine().split(" ") new Scanner(System.in).nextLine().split new Scanner(System.in).nextLine() new Scanner(System.in).nextLine new Scanner(System.in) " " int max = Integer.parseInt(info[0]); max Integer.parseInt(info[0]) Integer.parseInt Integer info[0] info 0 int sMin = Integer.parseInt(info[1]); sMin Integer.parseInt(info[1]) Integer.parseInt Integer info[1] info 1 int sMax = Integer.parseInt(info[2]); sMax Integer.parseInt(info[2]) Integer.parseInt Integer info[2] info 2 Long sum=0l; sum 0l for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		} Integer i = 1; Integer i = 1; i 1 i <= max i max i++ i++ i {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		} {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		} int s=0; s 0 for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			} int temp =i; int temp =i; temp i temp>0 temp 0 temp/=10 temp/=10 temp 10 {
				s+=temp%10;
			} {
				s+=temp%10;
			} s+=temp%10 s temp%10 temp 10 if (s >= sMin && s <= sMax)
				sum+=i.longValue(); s >= sMin && s <= sMax s >= sMin s sMin s <= sMax s sMax sum+=i.longValue() sum i.longValue() i.longValue i System.out.println(sum) System.out.println System.out System System.out sum public class Main {
	public static void main(String[] args) {
		atcode();
	}

	public static void atcode() {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		atcode();
	}

	public static void atcode() {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		atcode();
	}

	public static void atcode() {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		int max = Integer.parseInt(info[0]);
		int sMin = Integer.parseInt(info[1]);
		int sMax = Integer.parseInt(info[2]);
		Long sum=0l;
		for (Integer i = 1; i <= max; i++) {
			int s=0;
			for(int temp =i;temp>0;temp/=10){
				s+=temp%10;
			}
			if (s >= sMin && s <= sMax)
				sum+=i.longValue();
		}
		System.out.println(sum);
	}
}