import java.util.Scanner;
import java.util.*;

public 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 sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    }
} import java.util.Scanner; Scanner java.util import java.util.*; util.* java public 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 sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    }
} 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 sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    } 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 sum = 0; sum 0 for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        } int i=1; int i=1; i 1 i<n+1 i n+1 n 1 i++ i++ i {
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        } {
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        } int c1 = i % 10; c1 i % 10 i 10 int p = c1; p c1 if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            } i-c1 != 0 i-c1 i c1 0 {
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            } int c2 = (i-c1) % 100; c2 (i-c1) % 100 (i-c1) i c1 100 p = p + c2/10 p p + c2/10 p c2/10 c2 10 if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                } i-(c2+c1) != 0 i-(c2+c1) i (c2+c1) c2 c1 0 {
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                } int c3 = (i-(c2+c1)) % 1000; c3 (i-(c2+c1)) % 1000 (i-(c2+c1)) i (c2+c1) c2 c1 1000 p = p + c3/100 p p + c3/100 p c3/100 c3 100 if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    } i-(c1+c2+c3) != 0 i-(c1+c2+c3) i (c1+c2+c3) c1+c2+c3 c1 c2 c3 0 {
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    } int c4 = (i-(c2+c1+c3)) % 10000; c4 (i-(c2+c1+c3)) % 10000 (i-(c2+c1+c3)) i (c2+c1+c3) c2+c1+c3 c2 c1 c3 10000 p = p + c4/1000 p p + c4/1000 p c4/1000 c4 1000 if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        } i-(c1+c2+c3+c4) != 0 i-(c1+c2+c3+c4) i (c1+c2+c3+c4) c3 c1+c2+c3+c4 c1 c2 c3 c4 0 {
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        } int c5 = (i-(c2+c1+c3+c4)); c5 (i-(c2+c1+c3+c4)) i (c2+c1+c3+c4) c3 c2+c1+c3+c4 c2 c1 c3 c4 p = p + c5/10000 p p + c5/10000 p c5/10000 c5 10000 if(p >= a && p <= b ){
                sum = sum + i;
            } p >= a && p <= b p >= a p a p <= b p b {
                sum = sum + i;
            } sum = sum + i sum sum + i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public 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 sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    }
} public 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 sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    }
} Main
import java.util.Scanner;
import java.util.*;

public 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 sum = 0;

        for(int i=1; i<n+1; i++){
            int c1 = i % 10;
            int p = c1;
            if(i-c1 != 0){
                int c2 = (i-c1) % 100;
                p = p + c2/10;
                if(i-(c2+c1) != 0){
                    int c3 = (i-(c2+c1)) % 1000;
                    p = p + c3/100;
                    if(i-(c1+c2+c3) != 0){
                        int c4 = (i-(c2+c1+c3)) % 10000;
                        p = p + c4/1000;
                        if(i-(c1+c2+c3+c4) != 0){
                            int c5 = (i-(c2+c1+c3+c4));
                            p = p + c5/10000;
                        }
                    }
                }
            }
            if(p >= a && p <= b ){
                sum = sum + i;
            }
        }

        System.out.println(sum);


    }
}
