import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    }
    
    public static int calEachNum(int x){
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    }
    
    public static int calEachNum(int x){
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    }
} Main public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    } main {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(input[0]); n Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 int a = Integer.parseInt(input[1]); a Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 int b = Integer.parseInt(input[2]); b Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 int ans = 0; ans 0 for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        } {
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        } if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            } a <= calEachNum(i) && calEachNum(i) <= b a <= calEachNum(i) a calEachNum(i) calEachNum i calEachNum(i) <= b calEachNum(i) calEachNum i b {
                ans += i;
            } ans += i ans i out.println(ans) out.println out ans out.close() out.close out String[] args args public static int calEachNum(int x){
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    } calEachNum {
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    } int total = 0; total 0 boolean isLast = false; isLast false while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        } !isLast isLast {
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        } if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            } x >= 10 x 10 {
                total += x % 10;
                x /= 10;
            } total += x % 10 total x % 10 x 10 x /= 10 x 10 {
                total += x;
                isLast = true;
            } total += x total x isLast = true isLast true return total; total int x x public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    }
    
    public static int calEachNum(int x){
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    }
} public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    }
    
    public static int calEachNum(int x){
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            if(a <= calEachNum(i) && calEachNum(i) <= b){
                ans += i;
            }
        }
        
        out.println(ans);
        out.close();
        
    }
    
    public static int calEachNum(int x){
            
        int total = 0;
        boolean isLast = false;
            
        while(!isLast){
            if(x >= 10){
                total += x % 10;
                x /= 10;
            }else{
                total += x;
                isLast = true;
            }
        }
        return total;
    }
}