import java.util.Scanner;
public class Main{
	
	static int count(int a) {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	}

} import java.util.Scanner; Scanner java.util public class Main{
	
	static int count(int a) {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	}

} Main static int count(int a) {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	} count {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	} String aa = String.valueOf(a); aa String.valueOf(a) String.valueOf String a if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		} aa.length()==1 aa.length() aa.length aa 1 {
			return Integer.parseInt(aa);
			
			
			
		} return Integer.parseInt(aa); Integer.parseInt(aa) Integer.parseInt Integer aa {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		} int cnt = 0; cnt 0 for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			} int i = 0; int i = 0; i 0 i < aa.length() i aa.length() aa.length aa i++ i++ i {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			} {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			} int aaa = Integer.parseInt(aa.substring(i,i+1)); aaa Integer.parseInt(aa.substring(i,i+1)) Integer.parseInt Integer aa.substring(i,i+1) aa.substring aa i i+1 i 1 cnt += aaa cnt aaa return cnt; cnt int a a public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn int b = stdIn.nextInt(); b stdIn.nextInt() stdIn.nextInt stdIn long cnt = 0; cnt 0 for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		} {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		} if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			} count(i)>= a && count(i) <= b count(i)>= a count(i) count i a count(i) <= b count(i) count i b {
				cnt+=i;
			} cnt+=i cnt i System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main{
	
	static int count(int a) {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	}

} public class Main{
	
	static int count(int a) {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	}

} Main
import java.util.Scanner;
public class Main{
	
	static int count(int a) {
		/*int cnt = 0;
		while(a==0) {
			cnt++;
			a/=10;
		}
		return cnt;
		*/
		
		String aa = String.valueOf(a);
		
		if(aa.length()==1) {
			return Integer.parseInt(aa);
			
			
			
		}else {
			int cnt = 0;
			
			for(int i = 0; i < aa.length(); i++) {
				int aaa = Integer.parseInt(aa.substring(i,i+1));
				cnt += aaa;
			}
			return cnt;
			
			
		}
		
		
		
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		long cnt = 0;
		
		for(int i = 1; i <= n; i++) {
			if(count(i)>= a && count(i) <= b ) {
				cnt+=i;
			}
		}
		System.out.println(cnt);
		
	}

}
