import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) final int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long sums = 0; sums 0 for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        } {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        } int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10; sum i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10 i / 10 % 10 i / 100 % 10 i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10 i / 10000 i 10000 i / 1000 % 10 i / 1000 i 1000 10 i / 100 % 10 i / 100 i 100 10 i / 10 % 10 i / 10 i 10 10 i % 10 i 10 if (sum >= A && sum <= B)   sums += i; sum >= A && sum <= B sum >= A sum A sum <= B sum B sums += i sums i out.println(sums) out.println out sums out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int A = Integer.parseInt(sc.next());
        final int B = Integer.parseInt(sc.next());
        long sums = 0;
        
        for (int i = 1; i <= N; i++) {
            int sum = i / 10000 + i / 1000 % 10 + i / 100 % 10 + i / 10 % 10 + i % 10;
            if (sum >= A && sum <= B)   sums += i;
        }
        
        out.println(sums);
        
        out.flush();
    }
}