import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		}
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		}
	} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String n = scan.next(); n scan.next() scan.next scan int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int nI = Integer.parseInt(n); nI Integer.parseInt(n) Integer.parseInt Integer n int sum = 0; sum 0 for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		} int i=1; int i=1; i 1 i<=nI i nI i++ i++ i {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		} {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		} int keta = 0; keta 0 String iS = String.valueOf(i); iS String.valueOf(i) String.valueOf String i for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				} int l=0; int l=0; l 0 l<iS.length() l iS.length() iS.length iS l++ l++ l {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				} {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				} char ketaC[] = new char[iS.length()]; ketaC new char[iS.length()] iS.length() iS.length iS ketaC[l]=iS.charAt(l) ketaC[l] ketaC l iS.charAt(l) iS.charAt iS l keta = keta + Character.getNumericValue(ketaC[l]) keta keta + Character.getNumericValue(ketaC[l]) keta Character.getNumericValue(ketaC[l]) Character.getNumericValue Character ketaC[l] ketaC l if(keta>=a && keta<=b) {
				sum = sum + i;
			} keta>=a && keta<=b keta>=a keta a keta<=b keta b {
				sum = sum + i;
			} sum = sum + i sum sum + i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		}
	} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		}
	} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String n = scan.next();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int nI = Integer.parseInt(n);




		int sum = 0;
		for(int i=1;i<=nI;i++) {
			int keta = 0;
			String iS = String.valueOf(i);
			for(int l=0;l<iS.length();l++) {
				char ketaC[] = new char[iS.length()];
				ketaC[l]=iS.charAt(l);
				keta = keta + Character.getNumericValue(ketaC[l]);
				}
			//各桁の合計＝keta
			if(keta>=a && keta<=b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
		}
	}


