import 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 sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	}
} import java.util.*; util.* java 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 sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	}
} 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 sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

      int sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	} 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 sun = 0; sun 0 for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      } int i = 0 ; int i = 0 ; i 0 i <= n i n i++ i++ i {
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      } {
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      } int count = 0; count 0 int p = i; p i while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        } true {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        } count += p % 10 count p % 10 p 10 p = p / 10 p p / 10 p 10 if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          } p == 0 p 0 {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          } if ( count >= a && count <= b) {
            	sun += i;
            } count >= a && count <= b count >= a count a count <= b count b {
            	sun += i;
            } sun += i sun i break; System.out.println(sun) System.out.println System.out System System.out sun 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 sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	}
} 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 sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	}
} Main
import 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 sun = 0;
      for(int i = 0 ; i <= n ; i++){
      	int count = 0;
        int p = i;
        while(true) {
        	count += p % 10;
          p = p / 10;
          if ( p == 0) {
          	if ( count >= a && count <= b) {
            	sun += i;
            }
            break;
          }
          
        }
      }
      
		System.out.println(sun);
	}
}