import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    } 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 long sum2 = 0; sum2 0 for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        } {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i int sum = 0; sum 0 for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            } int j = 0; int j = 0; j 0 j < str.length() j str.length() str.length str j++ j++ j {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            } {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            } sum += Integer.parseInt(String.valueOf(str.charAt(j))) sum Integer.parseInt(String.valueOf(str.charAt(j))) Integer.parseInt Integer String.valueOf(str.charAt(j)) String.valueOf String str.charAt(j) str.charAt str j if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                sum2 = sum2 + i;
            } sum2 = sum2 + i sum2 sum2 + i sum2 i System.out.println(sum2) System.out.println System.out System System.out sum2 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    }
}
