import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
    
    public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
    
    public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    }
} Main public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    } main {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int sum = 0; sum 0 int numberCount = sc.nextInt(); numberCount sc.nextInt() sc.nextInt sc int more = sc.nextInt(); more sc.nextInt() sc.nextInt sc int less = sc.nextInt(); less sc.nextInt() sc.nextInt sc for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= numberCount i numberCount i++ i++ i {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        } {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        } int num = getKetaNoWa(i); num getKetaNoWa(i) getKetaNoWa i if (more <= num && num <= less) {
                sum += i;
            } more <= num && num <= less more <= num more num num <= less num less {
                sum += i;
            } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    } getKetaNoWa {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    } int sum = 0; sum 0 for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        } int i = 5; int i = 5; i 5 i >= 0 i 0 i-- i-- i {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        } {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        } int tmp = number / (int)Math.pow(10, i); tmp number / (int)Math.pow(10, i) number (int)Math.pow(10, i) Math.pow Math 10 i sum += tmp sum tmp number -= tmp * (int)Math.pow(10, i) number tmp * (int)Math.pow(10, i) tmp (int)Math.pow(10, i) Math.pow Math 10 i return sum; sum int number number public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
    
    public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    }
} public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
    
    public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    }
} Main
import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
    
    public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    }
}