import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    } main {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] s = scanner.nextLine().split(" "); s scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int n = Integer.parseInt(s[0]); n Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 int a = Integer.parseInt(s[1]); a Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 int b = Integer.parseInt(s[2]); b Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 2 int sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        } {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        } int p = i % 10; p i % 10 i 10 for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            } int j = i / 10; int j = i / 10; j i / 10 i 10 j > 0 j 0 j /= 10 j /= 10 j 10 {
                p += j % 10;
            } {
                p += j % 10;
            } p += j % 10 p j % 10 j 10 if (a <= p && p <= b) {
                sum += i;
            } a <= p && p <= b a <= p a p p <= b p b {
                sum += i;
            } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int a = Integer.parseInt(s[1]);
        int b = Integer.parseInt(s[2]);

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int p = i % 10;
            for (int j = i / 10; j > 0; j /= 10) {
                p += j % 10;
            }
            if (a <= p && p <= b) {
                sum += i;
            }
        }

        System.out.println(sum);
        scanner.close();
    }
}
