import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    }  
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    }  
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int count = 0; count 0 for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        } {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        } int num = 0; num 0 int m = i; m i while(m > 0) {
                num += m % 10;
                m /= 10;
            } m > 0 m 0 {
                num += m % 10;
                m /= 10;
            } num += m % 10 num m % 10 m 10 m /= 10 m 10 if(num >= a && num <= b) count += i; num >= a && num <= b num >= a num a num <= b num b count += i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    }  
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    }  
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int count = 0;
        for(int i=1; i<=n; i++) {
            int num = 0;
            int m = i;
            while(m > 0) {
                num += m % 10;
                m /= 10;
            }
            if(num >= a && num <= b) count += i;
        }
        System.out.println(count);
    }  
}