import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= 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 = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        }

        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        }

        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int sum = 0; sum 0 for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        } {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        } int one = i % 10; one i % 10 i 10 int two = (i%100) / 10; two (i%100) / 10 (i%100) i 100 10 int thr = (i%1000) / 100; thr (i%1000) / 100 (i%1000) i 1000 100 int fou = (i%10000) / 1000; fou (i%10000) / 1000 (i%10000) i 10000 1000 int five = (i%100000) / 10000; five (i%100000) / 10000 (i%100000) i 100000 10000 int num = one + two + thr + fou + five; num one + two + thr + fou + five fou thr one + two + thr + fou + five one two thr fou five if (num >= A && num <= B) {
                sum += i;
            } num >= A && num <= B num >= A num A num <= B num 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 = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= 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 = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int one = i % 10;
            int two = (i%100) / 10;
            int thr = (i%1000) / 100;
            int fou = (i%10000) / 1000;
            int five = (i%100000) / 10000;
            int num = one + two + thr + fou + five;

            if (num >= A && num <= B) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
}
