import java.util.Scanner;

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

public class Main{
	static int keta(int s) {
		int sum = 0;
		while(s > 0) {
			sum += (s % 10);
			s /= 10;
		}
		return sum;
	}
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt();
		int[] keta = new int[N + 1];
		for(int i = 0; i < N + 1; i++) keta[i] = keta(i);
		int sum = 0;
		for(int i = 1; i < N + 1; i++) {
			if(keta[i] >= A && keta[i] <= B) sum += i;
		}
		System.out.println(sum);
	}
}
