import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    }       

    public static int sumAllDigits(int num) {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    }       

    public static int sumAllDigits(int num) {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    }
} Main public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    } main {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = Integer.valueOf(sc.next()); n Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc final int a = Integer.valueOf(sc.next()); a Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc final int b = Integer.valueOf(sc.next()); b Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc int count=0; count 0 int allDigits=0; allDigits 0 for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        } {
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        } allDigits = sumAllDigits(i) allDigits sumAllDigits(i) sumAllDigits i count += (b >= allDigits && allDigits >= a)? i:0 count (b >= allDigits && allDigits >= a)? i:0 (b >= allDigits && allDigits >= a) b >= allDigits b allDigits allDigits >= a allDigits a i 0 System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc final String[] args args public static int sumAllDigits(int num) {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    } sumAllDigits {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    } int result = 0; result 0 while(num >= 10) {
            result += num % 10;
            num = num/10;
        } num >= 10 num 10 {
            result += num % 10;
            num = num/10;
        } result += num % 10 result num % 10 num 10 num = num/10 num num/10 num 10 return result + num; result + num result num int num num public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    }       

    public static int sumAllDigits(int num) {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    }
} public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    }       

    public static int sumAllDigits(int num) {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = Integer.valueOf(sc.next());
        final int a = Integer.valueOf(sc.next());
        final int b = Integer.valueOf(sc.next());
        int count=0;
        int allDigits=0;
        for(int i=1; i<=n; i++){
            allDigits = sumAllDigits(i);
            count += (b >= allDigits && allDigits >= a)? i:0;
        }
        System.out.println(count);
        sc.close();
    }       

    public static int sumAllDigits(int num) {
        int result = 0;
        while(num >= 10) {
            result += num % 10;
            num = num/10;
        }
        return result + num;
    }
}