import java.util.*;

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 sho = 0;
      	int amrS = 0;
	    int ans = 0;
      
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
} import java.util.*; util.* java 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 sho = 0;
      	int amrS = 0;
	    int ans = 0;
      
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
} 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 sho = 0;
      	int amrS = 0;
	    int ans = 0;
      
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
		int sho = 0;
      	int amrS = 0;
	    int ans = 0;
      
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    } 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 sho = 0; sho 0 int amrS = 0; amrS 0 int ans = 0; ans 0 for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      } int i = 1 ; int i = 1 ; i 1 i < n+1 i n+1 n 1 i++ i++ i {
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      } {
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      } sho = i sho i amrS= 0 amrS 0 while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        } sho != 0 sho 0 {
          amrS += sho%10;
          sho /= 10;
        } amrS += sho%10 amrS sho%10 sho 10 sho /= 10 sho 10 if(amrS >= a && amrS <= b){
        	ans += i; 
        } amrS >= a && amrS <= b amrS >= a amrS a amrS <= b amrS b {
        	ans += i; 
        } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

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 sho = 0;
      	int amrS = 0;
	    int ans = 0;
      
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}
