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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    }

    private static int sum(int a){
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return 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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    }

    private static int sum(int a){
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return 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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    } 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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    } 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 result = 0; result 0 int sum; sum for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        } {
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        } sum = sum(i) sum sum(i) sum i if(a<=sum && sum<=b){result+=i;} a<=sum && sum<=b a<=sum a sum sum<=b sum b {result+=i;} result+=i result i System.out.println(result) System.out.println System.out System System.out result String[] args args private static int sum(int a){
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return sum;
    } sum {
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return sum;
    } int sum = 0; sum 0 do {
            sum += (a%10);
            a = a/10;
        } while (a>0); a>0 a 0 {
            sum += (a%10);
            a = a/10;
        } sum += (a%10) sum (a%10) a 10 a = a/10 a a/10 a 10 return sum; sum int a a 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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    }

    private static int sum(int a){
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return 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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    }

    private static int sum(int a){
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return 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 result = 0;
        int sum;
        for(int i=1;i<=n;i++){
            sum = sum(i);
            if(a<=sum && sum<=b){result+=i;}
        }
        System.out.println(result);
        // System.out.println(sum(12123));
    }

    private static int sum(int a){
        int sum = 0;
        do {
            sum += (a%10);
            a = a/10;
        } while (a>0);
        return sum;
    }
}