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 x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	}
} 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 x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	}
} 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 x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	} 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 x = 0; x 0 for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		} int i = 1; int i = 1; i 1 i < N+1 i N+1 N 1 i++ i++ i {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		} {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		} int sum = 0; sum 0 int n; n int a = i; a i while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			} a != 0 a 0 {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			} n = a % 10 n a % 10 a 10 sum += n sum n a = (a-n)/10 a (a-n)/10 (a-n) a n 10 if(sum >= A && sum <= B) {
				x = x + i;
			} sum >= A && sum <= B sum >= A sum A sum <= B sum B {
				x = x + i;
			} x = x + i x x + i x i System.out.println(x) System.out.println System.out System System.out x String[] args args 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 x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	}
} 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 x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	}
} 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 x = 0;
		for (int i = 1;i < N+1; i++) {
			int sum = 0;
			int n;
			int a = i;
			while(a != 0) {
				n = a % 10;
				sum += n;
				a = (a-n)/10;
			}
			if(sum >= A && sum <= B) {
				x = x + i;
			}
		}
		System.out.println(x);
	}
}