import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    }
} Main public static void main(String[] args) {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    } main {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    } Scanner scanner =new Scanner(System.in); scanner new Scanner(System.in) int n=scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int a=scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b=scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int count=0; count 0 for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        } {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        } int c=0; c 0 for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            } int i1 = 0; int i1 = 0; i1 0 i1 < String.valueOf(i).length() i1 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i i1++ i1++ i1 {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            } {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            } c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1)) c c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1)) c Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1)) Integer.valueOf Integer String.valueOf(i).substring(i1, i1 + 1) String.valueOf(i).substring String.valueOf(i) String.valueOf String i i1 i1 + 1 i1 1 if (c>=a && c<=b){
                count=count+i;
            } c>=a && c<=b c>=a c a c<=b c b {
                count=count+i;
            } count=count+i count count+i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
         Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int count=0;
        for (int i = 1; i <= n; i++) {
            int c=0;
            for (int i1 = 0; i1 < String.valueOf(i).length(); i1++) {
                c=c+ Integer.valueOf(String.valueOf(i).substring(i1, i1 + 1));
            }
            if (c>=a && c<=b){
                count=count+i;
            }
        }System.out.println(count);
    }
}