import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        List<Integer> num = new ArrayList<Integer>();
        int total = 0;
        for(int i = 1; i < N+1; i++){
            num.add(i);
        }
        for(int v:num){
            total += result(v,A,B);
        }
        System.out.println(total);
    }

    static int result(int x,int A,int B) {
        int ans = 0,max = 0,xx = x;
        while (x >= 1) {
            ans = x % 10;
            max += ans;
            x /= 10;
        }
        if (A <= max && B >= max) {
            return xx;
        }else{
            return 0;
        }
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        List<Integer> num = new ArrayList<Integer>();
        int total = 0;
        for(int i = 1; i < N+1; i++){
            num.add(i);
        }
        for(int v:num){
            total += result(v,A,B);
        }
        System.out.println(total);
    }

    static int result(int x,int A,int B) {
        int ans = 0,max = 0,xx = x;
        while (x >= 1) {
            ans = x % 10;
            max += ans;
            x /= 10;
        }
        if (A <= max && B >= max) {
            return xx;
        }else{
            return 0;
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        List<Integer> num = new ArrayList<Integer>();
        int total = 0;
        for(int i = 1; i < N+1; i++){
            num.add(i);
        }
        for(int v:num){
            total += result(v,A,B);
        }
        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        List<Integer> num = new ArrayList<Integer>();
        int total = 0;
        for(int i = 1; i < N+1; i++){
            num.add(i);
        }
        for(int v:num){
            total += result(v,A,B);
        }
        System.out.println(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc List<Integer> num = new ArrayList<Integer>(); num new ArrayList<Integer>() int total = 0; total 0 for(int i = 1; i < N+1; i++){
            num.add(i);
        } int i = 1; int i = 1; i 1 i < N+1 i N+1 N 1 i++ i++ i {
            num.add(i);
        } {
            num.add(i);
        } num.add(i) num.add num i for(int v:num){
            total += result(v,A,B);
        } int v num {
            total += result(v,A,B);
        } {
            total += result(v,A,B);
        } total += result(v,A,B) total result(v,A,B) result v A B System.out.println(total) System.out.println System.out System System.out total String[] args args static int result(int x,int A,int B) {
        int ans = 0,max = 0,xx = x;
        while (x >= 1) {
            ans = x % 10;
            max += ans;
            x /= 10;
        }
        if (A <= max && B >= max) {
            return xx;
        }else{
            return 0;
        }
    } result {
        int ans = 0,max = 0,xx = x;
        while (x >= 1) {
            ans = x % 10;
            max += ans;
            x /= 10;
        }
        if (A <= max && B >= max) {
            return xx;
        }else{
            return 0;
        }
    } int ans = 0 ans 0 max = 0 max 0 xx = x; xx x while (x >= 1) {
            ans = x % 10;
            max += ans;
            x /= 10;
        } x >= 1 x 1 {
            ans = x % 10;
            max += ans;
            x /= 10;
        } ans = x % 10 ans x % 10 x 10 max += ans max ans x /= 10 x 10 if (A <= max && B >= max) {
            return xx;
        }else{
            return 0;
        } A <= max && B >= max A <= max A max B >= max B max {
            return xx;
        } return xx; xx {
            return 0;
        } return 0; 0 int x x int A A int B B
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        List<Integer> num = new ArrayList<Integer>();
        int total = 0;
        for(int i = 1; i < N+1; i++){
            num.add(i);
        }
        for(int v:num){
            total += result(v,A,B);
        }
        System.out.println(total);
    }

    static int result(int x,int A,int B) {
        int ans = 0,max = 0,xx = x;
        while (x >= 1) {
            ans = x % 10;
            max += ans;
            x /= 10;
        }
        if (A <= max && B >= max) {
            return xx;
        }else{
            return 0;
        }
    }
}
