import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int maxNum = sc.nextInt(); maxNum sc.nextInt() sc.nextInt sc int over = sc.nextInt(); over sc.nextInt() sc.nextInt sc int under = sc.nextInt(); under sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    } int num=1; int num=1; num 1 num<=maxNum num maxNum num++ num++ num {
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    } {
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    } String numStr = String.valueOf(num); numStr String.valueOf(num) String.valueOf String num if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        } numStr.length() == 1 numStr.length() numStr.length numStr 1 {
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        } int incNum = Integer.parseInt(numStr); incNum Integer.parseInt(numStr) Integer.parseInt Integer numStr if(incNum >= over && incNum <= under){
                ans += num;
            } incNum >= over && incNum <= under incNum >= over incNum over incNum <= under incNum under {
                ans += num;
            } ans += num ans num {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        } int plusNum = 0; plusNum 0 for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            } char charNum numStr.toCharArray() numStr.toCharArray numStr {
                plusNum += Integer.parseInt(String.valueOf(charNum));
            } {
                plusNum += Integer.parseInt(String.valueOf(charNum));
            } plusNum += Integer.parseInt(String.valueOf(charNum)) plusNum Integer.parseInt(String.valueOf(charNum)) Integer.parseInt Integer String.valueOf(charNum) String.valueOf String charNum if(plusNum >= over && plusNum <= under){
                ans += num;
            } plusNum >= over && plusNum <= under plusNum >= over plusNum over plusNum <= under plusNum under {
                ans += num;
            } ans += num ans num 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 sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int maxNum = sc.nextInt();
    int over = sc.nextInt();
    int under = sc.nextInt();

    int ans = 0;

    for(int num=1; num<=maxNum ; num++){
        String numStr = String.valueOf(num);
        if(numStr.length() == 1){
            int incNum = Integer.parseInt(numStr);
            if(incNum >= over && incNum <= under){
                ans += num;
            } 
        }else {
            int plusNum = 0;
            for(char charNum : numStr.toCharArray()){
                plusNum += Integer.parseInt(String.valueOf(charNum));
            }
            if(plusNum >= over && plusNum <= under){
                ans += num;
            }
        }
    }

    System.out.println(ans);
  }
}