import java.util.Scanner;

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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner 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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                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 k0 k0 k1 k1 k2 k2 k3 k3 k4 k4 k5 k5 ksum ksum sum = 0; sum 0 for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                sum += i;
            }
        } int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                sum += i;
            }
        } {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                sum += i;
            }
        } k5 = (i / 100000) % 10 k5 (i / 100000) % 10 (i / 100000) i 100000 10 k4 = (i / 10000) % 10 k4 (i / 10000) % 10 (i / 10000) i 10000 10 k3 = (i / 1000) % 10 k3 (i / 1000) % 10 (i / 1000) i 1000 10 k2 = (i / 100) % 10 k2 (i / 100) % 10 (i / 100) i 100 10 k1 = (i / 10) % 10 k1 (i / 10) % 10 (i / 10) i 10 10 k0 = i % 10 k0 i % 10 i 10 ksum = k0 + k1 + k2 + k3 + k4 + k5 ksum k0 + k1 + k2 + k3 + k4 + k5 k4 k3 k2 k0 + k1 + k2 + k3 + k4 + k5 k0 k1 k2 k3 k4 k5 if (A <= ksum && ksum <= B) {
                sum += i;
            } A <= ksum && ksum <= B A <= ksum A ksum ksum <= B ksum B {
                sum += i;
            } 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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
} Main
import java.util.Scanner;

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 k0,k1,k2,k3,k4,k5,ksum,sum = 0;

        for (int i = 0; i <= N; i++) {
            k5 = (i / 100000) % 10;
            k4 = (i / 10000) % 10;
            k3 = (i / 1000) % 10;
            k2 = (i / 100) % 10;
            k1 = (i / 10) % 10;
            k0 = i % 10;
            ksum = k0 + k1 + k2 + k3 + k4 + k5;
            if (A <= ksum && ksum <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
}
