import java.util.*;

class Main {
    static int findSumOfigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);

        int N = stdin.nextInt();
        int A = stdin.nextInt();
        int B = stdin.nextInt();
        int sumAB = 0;
        int lShift = 0;
        int sumD = 0;

        for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        }
        System.out.println(sumAB);
    }
} import java.util.*; util.* java class Main {
    static int findSumOfigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);

        int N = stdin.nextInt();
        int A = stdin.nextInt();
        int B = stdin.nextInt();
        int sumAB = 0;
        int lShift = 0;
        int sumD = 0;

        for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        }
        System.out.println(sumAB);
    }
} Main static int findSumOfigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } findSumOfigits {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } int sum = 0; sum 0 while (n > 0) {
            sum += n % 10;
            n /= 10;
        } n > 0 n 0 {
            sum += n % 10;
            n /= 10;
        } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);

        int N = stdin.nextInt();
        int A = stdin.nextInt();
        int B = stdin.nextInt();
        int sumAB = 0;
        int lShift = 0;
        int sumD = 0;

        for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        }
        System.out.println(sumAB);
    } main {
        Scanner stdin = new Scanner(System.in);

        int N = stdin.nextInt();
        int A = stdin.nextInt();
        int B = stdin.nextInt();
        int sumAB = 0;
        int lShift = 0;
        int sumD = 0;

        for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        }
        System.out.println(sumAB);
    } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int N = stdin.nextInt(); N stdin.nextInt() stdin.nextInt stdin int A = stdin.nextInt(); A stdin.nextInt() stdin.nextInt stdin int B = stdin.nextInt(); B stdin.nextInt() stdin.nextInt stdin int sumAB = 0; sumAB 0 int lShift = 0; lShift 0 int sumD = 0; sumD 0 for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        } int n = 1; int n = 1; n 1 n <= N n N n++ n++ n {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        } {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        } sumD = findSumOfigits(n) sumD findSumOfigits(n) findSumOfigits n if (sumD >= A && sumD <= B) {
                sumAB += n;
            } sumD >= A && sumD <= B sumD >= A sumD A sumD <= B sumD B {
                sumAB += n;
            } sumAB += n sumAB n System.out.println(sumAB) System.out.println System.out System System.out sumAB String[] args args
import java.util.*;

class Main {
    static int findSumOfigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);

        int N = stdin.nextInt();
        int A = stdin.nextInt();
        int B = stdin.nextInt();
        int sumAB = 0;
        int lShift = 0;
        int sumD = 0;

        for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        }
        System.out.println(sumAB);
    }
}
