import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args){
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	}
} Main public static void main(String[] args){
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	} main {
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	} 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 sc.close() sc.close sc int ret = 0; ret 0 int sum = 0; sum 0 int iTmp = 0; iTmp 0 for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		} {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		} sum = 0 sum 0 iTmp = i iTmp i while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			} iTmp != 0 iTmp 0 {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			} sum += iTmp%10 sum iTmp%10 iTmp 10 iTmp = iTmp / 10 iTmp iTmp / 10 iTmp 10 if(A <= sum && sum <= B) {
				ret += i;
			} A <= sum && sum <= B A <= sum A sum sum <= B sum B {
				ret += i;
			} ret += i ret i System.out.println(ret) System.out.println System.out System System.out ret String[] args args public class Main {

	public static void main(String[] args){
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	}
} public class Main {

	public static void main(String[] args){
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		// TODO ABC_083_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sum = 0;
		int iTmp = 0;

		for(int i=1; i<=N; i++) {
			sum = 0;
			iTmp = i;
			while(iTmp != 0) {
				sum += iTmp%10;
				iTmp = iTmp / 10;
			}
			if(A <= sum && sum <= B) {
				ret += i;
			}
		}

		// 出力
		System.out.println(ret);

	}
}
