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 s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	}
} 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 s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	}
} 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 s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	} 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 s =0; s 0 for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		} {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		} String temp = String.valueOf(i); temp String.valueOf(i) String.valueOf String i int sum =0; sum 0 for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			} int j=0; int j=0; j 0 j<temp.length() j temp.length() temp.length temp j++ j++ j {
				sum +=temp.charAt(j)-'0';
			} {
				sum +=temp.charAt(j)-'0';
			} sum +=temp.charAt(j)-'0' sum temp.charAt(j)-'0' temp.charAt(j) temp.charAt temp j '0' if (sum<=B&&sum>=A) {
				s+=i;
			} sum<=B&&sum>=A sum<=B sum B sum>=A sum A {
				s+=i;
			} s+=i s i System.out.println(s) System.out.println System.out System System.out s 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 s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	}
} 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 s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	}
} 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 s =0;
		for (int i=1;i<=N;i++) {
			String temp = String.valueOf(i);
			int sum =0;
			for (int j=0;j<temp.length();j++) {
				sum +=temp.charAt(j)-'0';
			}
			if (sum<=B&&sum>=A) {
				s+=i;
			}
		}
		System.out.println(s);
	}
}