import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	} main {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) int N=stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int A=stdIn.nextInt(); A stdIn.nextInt() stdIn.nextInt stdIn int B=stdIn.nextInt(); B stdIn.nextInt() stdIn.nextInt stdIn int z=1 z 1 y=0 y 0 x=0 x 0 ans=0; ans 0 while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		} z<=N z N {
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		} y=z y z while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			} true {
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			} x+=y%10 x y%10 y 10 y/=10 y 10 if(y==0)
					break; y==0 y 0 break; if(A<=x&&B>=x)
				ans+=z; A<=x&&B>=x A<=x A x B>=x B x ans+=z ans z x=0 x 0 z++ z System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		int z=1,y=0,x=0,ans=0;
		while(z<=N){
			y=z;
			while(true){
				x+=y%10;
				y/=10;
				if(y==0)
					break;
			}
			if(A<=x&&B>=x)
				ans+=z;
			x=0;
			z++;
		}
		System.out.println(ans);
	}
}