import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	}
	} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	}
	} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	} main {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan int b=scan.nextInt(); b scan.nextInt() scan.nextInt scan int c=scan.nextInt(); c scan.nextInt() scan.nextInt scan int count=0; count 0 for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		} int i=0; int i=0; i 0 i!=a+1 i a+1 a 1 i++ i++ i {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		} {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		} int C=0; C 0 for(int j=i;j!=0;j/=10) {
				C+=j%10;
			} int j=i; int j=i; j i j!=0 j 0 j/=10 j/=10 j 10 {
				C+=j%10;
			} {
				C+=j%10;
			} C+=j%10 C j%10 j 10 if(C>=b&&C<=c) {
				count+=i;
			} C>=b&&C<=c C>=b C b C<=c C c {
				count+=i;
			} count+=i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	}
	} public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	}
	} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int c=scan.nextInt();
		int count=0;
		for(int i=0;i!=a+1;i++) {
			int C=0;
			for(int j=i;j!=0;j/=10) {
				C+=j%10;
			}
			if(C>=b&&C<=c) {
				count+=i;
			}
		}
		System.out.println(count);
	}
	}
