import java.util.*;
import java.math.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    private int digitSum(int v) {
        int sum = 0;
        while (v > 0) {
            sum += (v % 10);
            v /= 10;
        }
        return sum;
    }

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        }
        System.out.println(sum);

        return;
    }

} import java.util.*; util.* java import java.math.*; math.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    private int digitSum(int v) {
        int sum = 0;
        while (v > 0) {
            sum += (v % 10);
            v /= 10;
        }
        return sum;
    }

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        }
        System.out.println(sum);

        return;
    }

} Solver private int digitSum(int v) {
        int sum = 0;
        while (v > 0) {
            sum += (v % 10);
            v /= 10;
        }
        return sum;
    } digitSum {
        int sum = 0;
        while (v > 0) {
            sum += (v % 10);
            v /= 10;
        }
        return sum;
    } int sum = 0; sum 0 while (v > 0) {
            sum += (v % 10);
            v /= 10;
        } v > 0 v 0 {
            sum += (v % 10);
            v /= 10;
        } sum += (v % 10) sum (v % 10) v 10 v /= 10 v 10 return sum; sum int v v public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        }
        System.out.println(sum);

        return;
    } run {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        }
        System.out.println(sum);

        return;
    } 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 sum = 0; sum 0 for (int i = 1; i <= N; i++) {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        } {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        } int s = digitSum(i); s digitSum(i) digitSum i if (s >= A && s <= B) {
                sum+=i;
            } s >= A && s <= B s >= A s A s <= B s B {
                sum+=i;
            } sum+=i sum i System.out.println(sum) System.out.println System.out System System.out sum return;
import java.util.*;
import java.math.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    private int digitSum(int v) {
        int sum = 0;
        while (v > 0) {
            sum += (v % 10);
            v /= 10;
        }
        return sum;
    }

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            int s = digitSum(i);
            if (s >= A && s <= B) {
                sum+=i;
            }
        }
        System.out.println(sum);

        return;
    }

}