import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    }
    
    public static int sumDigit(char[] c){
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    }
} import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    }
    
    public static int sumDigit(char[] c){
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    } 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 int ans = 0; ans 0 for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        } {
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        } int sum = sumDigit(String.valueOf(i).toCharArray()); sum sumDigit(String.valueOf(i).toCharArray()) sumDigit String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i if(a <= sum && sum <= b){
                ans += i;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                ans += i;
            } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int sumDigit(char[] c){
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    } sumDigit {
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    } int ret = 0; ret 0 int len = c.length; len c.length c c.length for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        } int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
            ret += Character.getNumericValue(c[i]);
        } {
            ret += Character.getNumericValue(c[i]);
        } ret += Character.getNumericValue(c[i]) ret Character.getNumericValue(c[i]) Character.getNumericValue Character c[i] c i return ret; ret char[] c c public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    }
    
    public static int sumDigit(char[] c){
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    }
    
    public static int sumDigit(char[] c){
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    }
} Main
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int i = 1; i <= n; i++){
            int sum = sumDigit(String.valueOf(i).toCharArray());
            if(a <= sum && sum <= b){
                ans += i;
            }
        }
        System.out.println(ans);
    }
    
    public static int sumDigit(char[] c){
        int ret = 0;
        int len = c.length;
        for(int i = 0; i < len; i++){
            ret += Character.getNumericValue(c[i]);
        }
        return ret;
    }
}