import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    } 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 cnt = 0; cnt 0 for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        } int i = a; int i = a; i a i <= n i n i++ i++ i {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        } {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        } int x = i; x i int total = x % 10; total x % 10 x 10 while (x >= 10) {
                x /= 10;
                total += x % 10;
            } x >= 10 x 10 {
                x /= 10;
                total += x % 10;
            } x /= 10 x 10 total += x % 10 total x % 10 x 10 if (total >= a && total <= b)
                cnt += i; total >= a && total <= b total >= a total a total <= b total b cnt += i cnt i System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cnt = 0;
        for (int i = a; i <= n; i++) {
            int x = i;
            int total = x % 10;
            while (x >= 10) {
                x /= 10;
                total += x % 10;
            }
            
            if (total >= a && total <= b)
                cnt += i;
        }
        
        System.out.println(cnt);
    }
}
