import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    }
} Main public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    } main {
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    } BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in)); stdR new BufferedReader(new InputStreamReader(System.in)) String[] s = stdR.readLine().split(" "); s stdR.readLine().split(" ") stdR.readLine().split stdR.readLine() stdR.readLine stdR " " int N = Integer.parseInt(s[0]); N Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 int A = Integer.parseInt(s[1]); A Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 int B = Integer.parseInt(s[2]); B Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 2 int num = 0; num 0 for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        } int i = 1 ; int i = 1 ; i 1 i <= N i N i++ i++ i {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        } {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i int count = 0; count 0 for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            } int j = 0 ; int j = 0 ; j 0 j < str.length() j str.length() str.length str j++ j++ j {
                count += Character.digit(str.charAt(j), 10);
            } {
                count += Character.digit(str.charAt(j), 10);
            } count += Character.digit(str.charAt(j), 10) count Character.digit(str.charAt(j), 10) Character.digit Character str.charAt(j) str.charAt str j 10 if(A <= count && count <= B) num+=i; A <= count && count <= B A <= count A count count <= B count B num+=i num i System.out.println(num) System.out.println System.out System System.out num String args[] args public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    }
} public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] s = stdR.readLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int A = Integer.parseInt(s[1]);
        int B = Integer.parseInt(s[2]);
        int num = 0;
        for(int i = 1 ; i <= N; i++) {
            String str = String.valueOf(i);
            int count = 0;
            for(int j = 0 ; j < str.length(); j++) {
                count += Character.digit(str.charAt(j), 10);
            }
            if(A <= count && count <= B) num+=i;
        }
        System.out.println(num);
    }
}
