import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	}
	public static int modsum(int n){
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	}
} 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();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	}
	public static int modsum(int n){
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int modsum=0; modsum 0 int sum=0; sum 0 for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		} int a=1; int a=1; a 1 a<=N a N a++ a++ a {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		} {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		} modsum = modsum(a) modsum modsum(a) modsum a if(A<=modsum&&modsum<=B) {
				sum += a;
			} A<=modsum&&modsum<=B A<=modsum A modsum modsum<=B modsum B {
				sum += a;
			} sum += a sum a System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int modsum(int n){
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	} modsum {
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	} int modsum = 0; modsum 0 while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		} n!=0 n 0 {
		    modsum += n % 10;
		    n /= 10;
		} modsum += n % 10 modsum n % 10 n 10 n /= 10 n 10 return modsum; modsum int n n public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	}
	public static int modsum(int n){
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	}
	public static int modsum(int n){
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int modsum=0;
		int sum=0;
		for(int a=1;a<=N;a++) {
			modsum = modsum(a);
			if(A<=modsum&&modsum<=B) {
				sum += a;
			}
		}
		System.out.println(sum);
	}
	public static int modsum(int n){
		int modsum = 0;
		while(n!=0) {
		    modsum += n % 10;
		    n /= 10;
		}
	 return modsum;
	}
}