import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int 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 ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        } {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        } int res = 0; res 0 String str = Integer.toString(i); str Integer.toString(i) Integer.toString Integer i for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            } int j = 0; int j = 0; j 0 j < str.length() j str.length() str.length str j++ j++ j {
                res += Character.getNumericValue(str.charAt(j));
            } {
                res += Character.getNumericValue(str.charAt(j));
            } res += Character.getNumericValue(str.charAt(j)) res Character.getNumericValue(str.charAt(j)) Character.getNumericValue Character str.charAt(j) str.charAt str j if(a <= res && res <= b){
                list.add(i);
            } a <= res && res <= b a <= res a res res <= b res b {
                list.add(i);
            } list.add(i) list.add list i int total = 0; total 0 for (Integer integer : list) {
            total += integer;
        } Integer integer list {
            total += integer;
        } {
            total += integer;
        } total += integer total integer System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    }
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//20
        int a = sc.nextInt();//2
        int b = sc.nextInt();//5
//        int n = 20;
//        int a = 2;
//        int b = 5;

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            int res = 0;
            String str = Integer.toString(i);
            for (int j = 0; j < str.length(); j++) {
                res += Character.getNumericValue(str.charAt(j));
            }
            if(a <= res && res <= b){
                list.add(i);
            }
        }

        int total = 0;
        for (Integer integer : list) {
            total += integer;
        }

        System.out.println(total);
    }
}
