import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	}
	public static int sample(int n) {
		return n;
	}

} 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(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	}
	public static int sample(int n) {
		return n;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc a = sc.nextInt() a sc.nextInt() sc.nextInt sc b=sc.nextInt(); b sc.nextInt() sc.nextInt sc long sum=0 sum 0 count=0 count 0 flag=0 flag 0 max=-999999 max -999999 999999 min=99999; min 99999 long[] array=new long[101]; array new long[101] 101 String buff; buff for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		} {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		} buff = String.valueOf(i) buff String.valueOf(i) String.valueOf String i for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			} int j=0; int j=0; j 0 j<buff.length() j buff.length() buff.length buff j++ j++ j {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			} {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			} sum+=Integer.parseInt(buff.substring(j,j+1)) sum Integer.parseInt(buff.substring(j,j+1)) Integer.parseInt Integer buff.substring(j,j+1) buff.substring buff j j+1 j 1 if(sum>=a&&sum<=b)count+=i; sum>=a&&sum<=b sum>=a sum a sum<=b sum b count+=i count i sum=0 sum 0 System.out.println(count) System.out.println System.out System System.out count String[] args args public static int sample(int n) {
		return n;
	} sample {
		return n;
	} return n; n int n n public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	}
	public static int sample(int n) {
		return n;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	}
	public static int sample(int n) {
		return n;
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(),b=sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[101];
		//String s=sc.next(),t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=1;i<=n;i++) {
			buff = String.valueOf(i);
			for(int j=0;j<buff.length();j++) {
				sum+=Integer.parseInt(buff.substring(j,j+1));
			}
			//System.out.println(sum);
			if(sum>=a&&sum<=b)count+=i;
			sum=0;
		}
		System.out.println(count);



	}
	public static int sample(int n) {
		return n;
	}

}
