import java.io.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br int space1 = input.indexOf(" "); space1 input.indexOf(" ") input.indexOf input " " int space2 = input.indexOf(" ", space1 +1); space2 input.indexOf(" ", space1 +1) input.indexOf input " " space1 +1 space1 1 int n = Integer.parseInt(input.substring(0,space1)); n Integer.parseInt(input.substring(0,space1)) Integer.parseInt Integer input.substring(0,space1) input.substring input 0 space1 int a = Integer.parseInt(input.substring(space1+1, space2)); a Integer.parseInt(input.substring(space1+1, space2)) Integer.parseInt Integer input.substring(space1+1, space2) input.substring input space1+1 space1 1 space2 int b = Integer.parseInt(input.substring(space2+1)); b Integer.parseInt(input.substring(space2+1)) Integer.parseInt Integer input.substring(space2+1) input.substring input space2+1 space2 1 int ans = 0; ans 0 for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        } int i = 1; int i = 1; i 1 i<n+1 i n+1 n 1 i++ i++ i {
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        } {
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        } int now = i; now i int sum = 0; sum 0 for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            } int j = 0; int j = 0; j 0 j<String.valueOf(n).length() j String.valueOf(n).length() String.valueOf(n).length String.valueOf(n) String.valueOf String n j++ j++ j {
                sum = sum + now%10;
                now = (now-now%10)/10;
            } {
                sum = sum + now%10;
                now = (now-now%10)/10;
            } sum = sum + now%10 sum sum + now%10 sum now%10 now 10 now = (now-now%10)/10 now (now-now%10)/10 (now-now%10) now now%10 now 10 10 if(a<=sum && sum<=b){
                ans = ans + i;
            } a<=sum && sum<=b a<=sum a sum sum<=b sum b {
                ans = ans + i;
            } ans = ans + i ans ans + i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    }
} public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    }
} Main
import java.io.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String input = br.readLine();
        int space1 = input.indexOf(" ");
        int space2 = input.indexOf(" ", space1 +1);
        int n = Integer.parseInt(input.substring(0,space1));
        int a = Integer.parseInt(input.substring(space1+1, space2));
        int b = Integer.parseInt(input.substring(space2+1));

        int ans = 0;

        for(int i = 1; i<n+1; i++){
            int now = i;
            int sum = 0;
            for(int j = 0; j<String.valueOf(n).length(); j++){
                sum = sum + now%10;
                now = (now-now%10)/10;
            }
            //ここでチェックしてもいいかも
            if(a<=sum && sum<=b){
                ans = ans + i;
            }
        }
        System.out.println(ans);
    }
}
